From e0ac29320095bf71d7af3362c4abd2c016099372 Mon Sep 17 00:00:00 2001 From: vc-ci Date: Tue, 13 Feb 2024 13:44:21 +0000 Subject: [PATCH 1/3] 3.806.0 --- Directory.Build.props | 2 +- src/VirtoCommerce.OrdersModule.Web/module.manifest | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Directory.Build.props b/Directory.Build.props index 22040461..d7980b9f 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -2,7 +2,7 @@ - 3.805.0 + 3.806.0 $(VersionSuffix)-$(BuildNumber) diff --git a/src/VirtoCommerce.OrdersModule.Web/module.manifest b/src/VirtoCommerce.OrdersModule.Web/module.manifest index 567411e5..5624d51d 100644 --- a/src/VirtoCommerce.OrdersModule.Web/module.manifest +++ b/src/VirtoCommerce.OrdersModule.Web/module.manifest @@ -1,7 +1,7 @@ VirtoCommerce.Orders - 3.805.0 + 3.806.0 3.800.0 From 3e3e1395aa37b2f5e7a713549991a89b9cdf5dbf Mon Sep 17 00:00:00 2001 From: vc-ci Date: Tue, 27 Feb 2024 05:00:03 +0000 Subject: [PATCH 2/3] ci: Auto update Github Action workflows --- .github/workflows/module-ci.yml | 10 +++++----- .github/workflows/module-release-hotfix.yml | 4 ++-- .github/workflows/publish-nugets.yml | 4 ++-- .github/workflows/release.yml | 4 ++-- 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/.github/workflows/module-ci.yml b/.github/workflows/module-ci.yml index 3a9a9f6b..0e2434ee 100644 --- a/.github/workflows/module-ci.yml +++ b/.github/workflows/module-ci.yml @@ -1,5 +1,5 @@ -# v3.800.2 -# https://virtocommerce.atlassian.net/browse/VCST-349 +# v3.800.3 +# https://virtocommerce.atlassian.net/browse/VCST-570 name: Module CI on: @@ -128,7 +128,7 @@ jobs: run: vc-build Compress -skip Clean+Restore+Compile+Test - name: Publish Nuget - if: ${{ github.ref == 'refs/heads/master' && github.event_name != 'workflow_dispatch' }} + if: ${{ github.ref == 'refs/heads/master' }} uses: VirtoCommerce/vc-github-actions/publish-nuget@master - name: Publish to Blob @@ -192,13 +192,13 @@ jobs: fi - name: Setup Git Credentials - if: ${{ (github.ref == 'refs/heads/dev' || github.ref == 'refs/heads/master') && github.event_name != 'workflow_dispatch' }} + if: ${{ (github.ref == 'refs/heads/dev' && github.event_name != 'workflow_dispatch') || github.ref == 'refs/heads/master' }} uses: VirtoCommerce/vc-github-actions/setup-git-credentials-github@master with: githubToken: ${{ secrets.REPO_TOKEN }} - name: Publish Manifest - if: ${{ (github.ref == 'refs/heads/dev' || github.ref == 'refs/heads/master') && github.event_name != 'workflow_dispatch' }} + if: ${{ (github.ref == 'refs/heads/dev' && github.event_name != 'workflow_dispatch') || github.ref == 'refs/heads/master' }} uses: VirtoCommerce/vc-github-actions/publish-manifest@master with: packageUrl: ${{ steps.artifactUrl.outputs.download_url }} diff --git a/.github/workflows/module-release-hotfix.yml b/.github/workflows/module-release-hotfix.yml index 519c5a82..0e84ad49 100644 --- a/.github/workflows/module-release-hotfix.yml +++ b/.github/workflows/module-release-hotfix.yml @@ -1,5 +1,5 @@ -# v3.800.2 -# https://virtocommerce.atlassian.net/browse/VCST-349 +# v3.800.3 +# https://virtocommerce.atlassian.net/browse/VCST-570 name: Release hotfix on: diff --git a/.github/workflows/publish-nugets.yml b/.github/workflows/publish-nugets.yml index f92e2d6d..4599fe33 100644 --- a/.github/workflows/publish-nugets.yml +++ b/.github/workflows/publish-nugets.yml @@ -1,5 +1,5 @@ -# v3.800.2 -# https://virtocommerce.atlassian.net/browse/VCST-349 +# v3.800.3 +# https://virtocommerce.atlassian.net/browse/VCST-570 name: Publish nuget on: diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 034cf006..9a1503a9 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,5 +1,5 @@ -# v3.800.2 -# https://virtocommerce.atlassian.net/browse/VCST-349 +# v3.800.3 +# https://virtocommerce.atlassian.net/browse/VCST-570 name: Release on: From 08411bc7a3c335790c57511909a571cb0d819ec9 Mon Sep 17 00:00:00 2001 From: Basil Kotov Date: Fri, 1 Mar 2024 12:52:12 +0000 Subject: [PATCH 3/3] clear cache (#406) Co-authored-by: Oleg Zhuk --- .../Services/PaymentService.cs | 26 +++++++++++++++---- 1 file changed, 21 insertions(+), 5 deletions(-) diff --git a/src/VirtoCommerce.OrdersModule.Data/Services/PaymentService.cs b/src/VirtoCommerce.OrdersModule.Data/Services/PaymentService.cs index b7df22b2..9c34d818 100644 --- a/src/VirtoCommerce.OrdersModule.Data/Services/PaymentService.cs +++ b/src/VirtoCommerce.OrdersModule.Data/Services/PaymentService.cs @@ -7,6 +7,7 @@ using VirtoCommerce.OrdersModule.Core.Services; using VirtoCommerce.OrdersModule.Data.Model; using VirtoCommerce.OrdersModule.Data.Repositories; +using VirtoCommerce.Platform.Caching; using VirtoCommerce.Platform.Core.Caching; using VirtoCommerce.Platform.Core.Common; using VirtoCommerce.Platform.Core.Events; @@ -67,26 +68,41 @@ protected virtual async Task DoBulkActionsWithOrderAggregate(IList pa { throw new OperationCanceledException($"{nameof(PaymentIn.OrderId)} must be set."); } - var oderIds = payments.Select(x => x.OrderId).Distinct().ToArray(); - if (oderIds.Any()) + var orderIds = payments.Select(x => x.OrderId).Distinct().ToArray(); + if (orderIds.Length > 0) { - var ordersAggregates = await _customerOrderService.GetAsync(oderIds); + var ordersAggregates = await _customerOrderService.GetAsync(orderIds); foreach (var payment in payments) { var orderAggregateRoot = ordersAggregates.FirstOrDefault(x => x.Id == payment.OrderId); if (orderAggregateRoot != null) { - orderAggregateRoot.InPayments.Remove(payment); - orderAggregateRoot.InPayments.Add(payment); + action(orderAggregateRoot, payment); } } await _customerOrderService.SaveChangesAsync(ordersAggregates.ToArray()); } + ClearCache(payments); } protected override Task> LoadEntities(IRepository repository, IList ids, string responseGroup) { return ((IOrderRepository)repository).GetPaymentsByIdsAsync(ids); } + + protected override void ClearCache(IList models) + { + base.ClearCache(models); + + // Clear order cache + GenericSearchCachingRegion.ExpireRegion(); + + var orderIds = models.Select(x => x.OrderId).Distinct().ToArray(); + + foreach (var id in orderIds) + { + GenericCachingRegion.ExpireTokenForKey(id); + } + } } }