Skip to content

Commit

Permalink
Merge branch 'release/3.402.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
vc-ci committed Oct 26, 2023
2 parents efb25e4 + d090eff commit fdb2269
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 31 deletions.
2 changes: 1 addition & 1 deletion Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<Project>
<!-- These properties will be shared for all projects -->
<PropertyGroup>
<VersionPrefix>3.401.0</VersionPrefix>
<VersionPrefix>3.402.0</VersionPrefix>
<VersionSuffix></VersionSuffix>
<VersionSuffix Condition=" '$(VersionSuffix)' != '' AND '$(BuildNumber)' != '' ">$(VersionSuffix)-$(BuildNumber)</VersionSuffix>
</PropertyGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,35 +113,11 @@ public virtual async Task SaveSubscriptionsAsync(Subscription[] subscriptions)
subscription.Number = _uniqueNumberGenerator.GenerateNumber(numberTemplate);
}

//Save subscription order prototype with same as subscription Number
if (subscription.CustomerOrderPrototype != null && (
subscription.CustomerOrderPrototype.Number != subscription.Number ||
!subscription.CustomerOrderPrototype.IsPrototype))
//Save subscription order prototype and reload it to refresh RowVersion
if (subscription.CustomerOrderPrototype != null)
{
var order = await _customerOrderService.GetByIdAsync(subscription.CustomerOrderPrototype.Id);
order.Number = subscription.Number;
order.IsPrototype = true;

await _customerOrderService.SaveChangesAsync(new[] { order });
}

if (subscription.CustomerOrders != null)
{
var modifiedOrders = new List<CustomerOrder>();

foreach (var order in subscription.CustomerOrders)
{
if (order.SubscriptionNumber != subscription.Number)
{
var modifiedOrder = await _customerOrderService.GetByIdAsync(order.Id);
modifiedOrders.Add(modifiedOrder);
}
}

if (modifiedOrders.Any())
{
await _customerOrderService.SaveChangesAsync(modifiedOrders);
}
await _customerOrderService.SaveChangesAsync(new[] { subscription.CustomerOrderPrototype });
subscription.CustomerOrderPrototype = await _customerOrderService.GetByIdAsync(subscription.CustomerOrderPrototype.Id);
}

var originalEntity = existEntities.FirstOrDefault(x => x.Id == subscription.Id);
Expand Down
4 changes: 2 additions & 2 deletions src/VirtoCommerce.SubscriptionModule.Web/module.manifest
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<module xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<id>VirtoCommerce.Subscription</id>
<version>3.401.0</version>
<version>3.402.0</version>
<version-tag />
<platformVersion>3.400.0</platformVersion>
<dependencies>
Expand Down

0 comments on commit fdb2269

Please sign in to comment.