Skip to content

Commit

Permalink
Merge branch 'release/3.804.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
vc-ci committed Feb 9, 2024
2 parents 2b70fdd + 51e4ce9 commit a4d8480
Show file tree
Hide file tree
Showing 11 changed files with 36 additions and 34 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.803.0</VersionPrefix>
<VersionPrefix>3.804.0</VersionPrefix>
<VersionSuffix>
</VersionSuffix>
<VersionSuffix Condition=" '$(VersionSuffix)' != '' AND '$(BuildNumber)' != '' ">$(VersionSuffix)-$(BuildNumber)</VersionSuffix>
Expand Down
4 changes: 3 additions & 1 deletion src/VirtoCommerce.OrdersModule.Core/ModuleConstants.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@ namespace VirtoCommerce.OrdersModule.Core
[ExcludeFromCodeCoverage]
public class ModuleConstants
{
public static string OrderIndexDocumentType { get; } = nameof(CustomerOrder);
public const string OrderIndexDocumentTypeConstant = nameof(CustomerOrder);

public static string OrderIndexDocumentType { get; } = OrderIndexDocumentTypeConstant;

public static class Security
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
<ItemGroup>
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="8.0.0" PrivateAssets="All" />
<PackageReference Include="VirtoCommerce.CartModule.Core" Version="3.800.0" />
<PackageReference Include="VirtoCommerce.CoreModule.Core" Version="3.800.0" />
<PackageReference Include="VirtoCommerce.CoreModule.Core" Version="3.803.0" />
<PackageReference Include="VirtoCommerce.CustomerModule.Core" Version="3.800.0" />
<PackageReference Include="VirtoCommerce.NotificationsModule.Core" Version="3.800.0" />
<PackageReference Include="VirtoCommerce.PaymentModule.Core" Version="3.800.0" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public class CustomerOrderService : CrudService<CustomerOrder, CustomerOrderEnti
private readonly Func<IOrderRepository> _repositoryFactory;
private readonly IPlatformMemoryCache _platformMemoryCache;
private readonly IEventPublisher _eventPublisher;
private readonly IUniqueNumberGenerator _uniqueNumberGenerator;
private readonly ITenantUniqueNumberGenerator _uniqueNumberGenerator;
private readonly IStoreService _storeService;
private readonly ICustomerOrderTotalsCalculator _totalsCalculator;
private readonly IShippingMethodsSearchService _shippingMethodsSearchService;
Expand All @@ -41,7 +41,7 @@ public CustomerOrderService(
Func<IOrderRepository> repositoryFactory,
IPlatformMemoryCache platformMemoryCache,
IEventPublisher eventPublisher,
IUniqueNumberGenerator uniqueNumberGenerator,
ITenantUniqueNumberGenerator uniqueNumberGenerator,
IStoreService storeService,
ICustomerOrderTotalsCalculator totalsCalculator,
IShippingMethodsSearchService shippingMethodsSearchService,
Expand Down Expand Up @@ -245,7 +245,7 @@ protected virtual async Task EnsureThatAllOperationsHaveNumber(CustomerOrder ord
numberTemplate = store.Settings.GetValue<string>(descriptor);
}

operation.Number = _uniqueNumberGenerator.GenerateNumber(numberTemplate);
operation.Number = _uniqueNumberGenerator.GenerateNumber(order.StoreId, numberTemplate);
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public class PaymentFlowService : IPaymentFlowService
private readonly IPaymentService _paymentService;
private readonly IStoreService _storeService;
private readonly IValidator<OrderPaymentInfo> _validator;
private readonly IUniqueNumberGenerator _uniqueNumberGenerator;
private readonly ITenantUniqueNumberGenerator _uniqueNumberGenerator;

protected virtual string[] CaptureRuleSets => new[] { PaymentRequestValidator.DefaultRuleSet, PaymentRequestValidator.CaptureRuleSet };
protected virtual string[] RefundRuleSets => new[] { PaymentRequestValidator.DefaultRuleSet, PaymentRequestValidator.RefundRuleSet };
Expand All @@ -38,7 +38,7 @@ public PaymentFlowService(
IPaymentService paymentService,
IStoreService storeService,
IValidator<OrderPaymentInfo> validator,
IUniqueNumberGenerator uniqueNumberGenerator)
ITenantUniqueNumberGenerator uniqueNumberGenerator)
{
_customerOrderService = customerOrderService;
_paymentService = paymentService;
Expand Down Expand Up @@ -322,7 +322,7 @@ protected virtual Refund CreateRefund(PaymentIn payment, Store store, RefundOrde
var refund = AbstractTypeFactory<Refund>.TryCreateInstance();

var numberTemplate = store.Settings.GetValue<string>(Core.ModuleConstants.Settings.General.RefundNewNumberTemplate);
refund.Number = _uniqueNumberGenerator.GenerateNumber(numberTemplate.ToString());
refund.Number = _uniqueNumberGenerator.GenerateNumber(store.Id, numberTemplate);

refund.Amount = request.Amount ?? payment.Sum;
refund.ReasonCode = EnumUtility.SafeParse(request.ReasonCode, RefundReasonCode.Other);
Expand Down Expand Up @@ -359,7 +359,7 @@ protected virtual Capture CreateCapture(PaymentIn payment, Store store, CaptureO
var capture = AbstractTypeFactory<Capture>.TryCreateInstance();

var numberTemplate = store.Settings.GetValue<string>(Core.ModuleConstants.Settings.General.CaptureNewNumberTemplate);
capture.Number = _uniqueNumberGenerator.GenerateNumber(numberTemplate.ToString());
capture.Number = _uniqueNumberGenerator.GenerateNumber(store.Id, numberTemplate);

capture.Amount = request.Amount ?? payment.Sum;
capture.Comment = request.CaptureDetails;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ public class OrderModuleController : Controller
{
private readonly ICustomerOrderService _customerOrderService;
private readonly ICustomerOrderSearchService _searchService;
private readonly IUniqueNumberGenerator _uniqueNumberGenerator;
private readonly ITenantUniqueNumberGenerator _uniqueNumberGenerator;
private readonly IStoreService _storeService;
private readonly IPlatformMemoryCache _platformMemoryCache;
private readonly ICustomerOrderStatisticService _customerOrderStatisticService;
Expand All @@ -73,7 +73,7 @@ public OrderModuleController(
ICustomerOrderService customerOrderService
, ICustomerOrderSearchService searchService
, IStoreService storeService
, IUniqueNumberGenerator numberGenerator
, ITenantUniqueNumberGenerator numberGenerator
, IPlatformMemoryCache platformMemoryCache
, ICustomerOrderStatisticService customerOrderStatisticService
, ICustomerOrderBuilder customerOrderBuilder
Expand Down Expand Up @@ -423,7 +423,7 @@ public async Task<ActionResult<Shipment>> GetNewShipment(string id)
retVal.Status = "New";

var numberTemplate = store.Settings.GetValue<string>(ModuleConstants.Settings.General.OrderShipmentNewNumberTemplate);
retVal.Number = _uniqueNumberGenerator.GenerateNumber(numberTemplate.ToString());
retVal.Number = _uniqueNumberGenerator.GenerateNumber(store.Id, numberTemplate);

return Ok(retVal);
}
Expand Down Expand Up @@ -456,7 +456,7 @@ public async Task<ActionResult<PaymentIn>> GetNewPayment(string id)
retVal.Status = retVal.PaymentStatus.ToString();

var numberTemplate = store.Settings.GetValue<string>(ModuleConstants.Settings.General.OrderPaymentInNewNumberTemplate);
retVal.Number = _uniqueNumberGenerator.GenerateNumber(numberTemplate.ToString());
retVal.Number = _uniqueNumberGenerator.GenerateNumber(store.Id, numberTemplate);
return Ok(retVal);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -447,20 +447,20 @@
"description": "Refund statuses"
},
"Order.CustomerOrderNewNumberTemplate": {
"description": "This template will be used to generate the ID for a new Customer Order. Parameters: 0: Date and time (UTC) the ID was generated at, 1: Order ID",
"title": "Order ID template"
"description": "Used to generate new Customer Order Number, with parameters:\n\n0: Date and Time in UTC\n1: Counter\n\nFormat supports counter options directly within the template using the format:\n<number_template>@<reset_counter_type>[:<start_counter_from>[:<counter_increment>]]\n\nDefault values:\n* Daily for reset_counter_type. Choose from None, Daily, Weekly, Monthly, and Yearly reset counter types.\n* 1 for start_counter_from.\n* 1 for counter_increment.\n\nExample: CO{0:yyMMdd}-{1:D5}@Weekly:1:10.\nResult: CO240101-00001.",
"title": "Order number template"
},
"Order.ShipmentNewNumberTemplate": {
"description": "This template will be used to generate the ID for a new Shipment. Parameters: 0: Date and time (UTC) the ID was generated at, 1: Order ID",
"title": "Order shipment ID template"
"description": "Used to generate new Shipment Number, with parameters:\n\n0: Date and Time in UTC\n1: Counter\n\nFormat supports counter options directly within the template using the format:\n<number_template>@<reset_counter_type>[:<start_counter_from>[:<counter_increment>]]\n\nDefault values:\n* Daily for reset_counter_type. Choose from None, Daily, Weekly, Monthly, and Yearly reset counter types.\n* 1 for start_counter_from.\n* 1 for counter_increment.\n\nExample: CO{0:yyMMdd}-{1:D5}@Weekly:1:10.\nResult: CO240101-00001.",
"title": "Order shipment number template"
},
"Order.PaymentInNewNumberTemplate": {
"description": "This template will be used to generate the ID for a new incoming Payment. Parameters: 0: Date and time (UTC) the ID was generated at, 1: Order ID",
"title": "Order payment ID template"
"description": "Used to generate new Payment Number, with parameters:\n\n0: Date and Time in UTC\n1: Counter\n\nFormat supports counter options directly within the template using the format:\n<number_template>@<reset_counter_type>[:<start_counter_from>[:<counter_increment>]]\n\nDefault values:\n* Daily for reset_counter_type. Choose from None, Daily, Weekly, Monthly, and Yearly reset counter types.\n* 1 for start_counter_from.\n* 1 for counter_increment.\n\nExample: CO{0:yyMMdd}-{1:D5}@Weekly:1:10.\nResult: CO240101-00001.",
"title": "Order payment number template"
},
"Order.RefundNewNumberTemplate": {
"description": "This template will be used to generate the ID for a new order Refund. Parameters: 0: Date and time (UTC) the ID was generated at, 1: Order ID",
"title": "Order refund ID template"
"description": "Used to generate new Refund Number, with parameters:\n\n0: Date and Time in UTC\n1: Counter\n\nFormat supports counter options directly within the template using the format:\n<number_template>@<reset_counter_type>[:<start_counter_from>[:<counter_increment>]]\n\nDefault values:\n* Daily for reset_counter_type. Choose from None, Daily, Weekly, Monthly, and Yearly reset counter types.\n* 1 for start_counter_from.\n* 1 for counter_increment.\n\nExample: CO{0:yyMMdd}-{1:D5}@Weekly:1:10.\nResult: CO240101-00001.",
"title": "Order refund number template"
},
"Order.SendOrderNotifications": {
"description": "Sends a notification when the order status changes",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -317,16 +317,16 @@
"title": "Статусы платежей"
},
"Order.CustomerOrderNewNumberTemplate": {
"description": "Этот шаблон будет использоваться для создания ID нового Заказа. Параметры: 0: Дата и время (UTC), когда был сгенерирован ID, 1: ID заказа.",
"title": "Шаблон ID заказа"
"description": "Используется для создания нового номера заказов с параметрами:\n\n0: дата и время в формате UTC.\n1: Счетчик\n\nПоддерживает параметры счетчика непосредственно в шаблоне, используя формат:\n<number_template>@<reset_counter_type>[:<start_counter_from>[:<counter_increment>]]\n\nЗначения по умолчанию:\n* Ежедневно для reset_counter_type. Выберите типы счетчиков сброса «Нет», «Ежедневно», «Еженедельно», «Ежемесячно» и «Ежегодно».\n* 1 для start_counter_from.\n* 1 для counter_increment.\n\nПример: CO{0:yyMMdd}-{1:D5}@Weekly:1:10.\nРезультат: CO240101-00001.",
"title": "Шаблон номера заказа"
},
"Order.ShipmentNewNumberTemplate": {
"description": "Этот шаблон будет использоваться для создания ID новой доставки. Параметры: 0: Дата и время (UTC), когда был сгенерирован ID, 1: ID заказа.",
"title": "Шаблон ID доставки заказа"
"description": "Используется для создания нового номера документа доставки с параметрами:\n\n0: дата и время в формате UTC.\n1: Счетчик\n\nПоддерживает параметры счетчика непосредственно в шаблоне, используя формат:\n<number_template>@<reset_counter_type>[:<start_counter_from>[:<counter_increment>]]\n\nЗначения по умолчанию:\n* Ежедневно для reset_counter_type. Выберите типы счетчиков сброса «Нет», «Ежедневно», «Еженедельно», «Ежемесячно» и «Ежегодно».\n* 1 для start_counter_from.\n* 1 для counter_increment.\n\nПример: CO{0:yyMMdd}-{1:D5}@Weekly:1:10.\nРезультат: CO240101-00001.",
"title": "Шаблон номера документа доставки"
},
"Order.PaymentInNewNumberTemplate": {
"description": "Этот шаблон будет использоваться для генерации ID нового входящего платежа. Параметры: 0: Дата и время (UTC), когда был сгенерирован ID, 1: ID заказа.",
"title": "Шаблон ID оплаты заказа"
"description": "Используется для создания нового номера платежного документа с параметрами:\n\n0: дата и время в формате UTC.\n1: Счетчик\n\nПоддерживает параметры счетчика непосредственно в шаблоне, используя формат:\n<number_template>@<reset_counter_type>[:<start_counter_from>[:<counter_increment>]]\n\nЗначения по умолчанию:\n* Ежедневно для reset_counter_type. Выберите типы счетчиков сброса «Нет», «Ежедневно», «Еженедельно», «Ежемесячно» и «Ежегодно».\n* 1 для start_counter_from.\n* 1 для counter_increment.\n\nПример: CO{0:yyMMdd}-{1:D5}@Weekly:1:10.\nРезультат: CO240101-00001.",
"title": "Шаблон номера платежного документа"
},
"Order.SendOrderNotifications": {
"description": "Отправление уведомлений при изменении статуса заказа",
Expand Down
4 changes: 2 additions & 2 deletions src/VirtoCommerce.OrdersModule.Web/module.manifest
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
<?xml version="1.0" encoding="utf-8"?>
<module>
<id>VirtoCommerce.Orders</id>
<version>3.803.0</version>
<version>3.804.0</version>
<version-tag />
<platformVersion>3.800.0</platformVersion>
<dependencies>
<dependency id="VirtoCommerce.Cart" version="3.800.0" />
<dependency id="VirtoCommerce.Catalog" version="3.800.0" />
<dependency id="VirtoCommerce.Core" version="3.800.0" />
<dependency id="VirtoCommerce.Core" version="3.803.0" />
<dependency id="VirtoCommerce.Customer" version="3.800.0" />
<dependency id="VirtoCommerce.Inventory" version="3.800.0" />
<dependency id="VirtoCommerce.Notifications" version="3.800.0" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ public class CustomerOrderServiceImplIntegrationTests
private readonly Mock<IPaymentMethodsRegistrar> _paymentMethodRegistrarMock;
private readonly Mock<IPaymentMethodsSearchService> _paymentMethodsSearchService;
private readonly Mock<ICustomerOrderTotalsCalculator> _customerOrderTotalsCalculatorMock;
private readonly Mock<IUniqueNumberGenerator> _uniqueNumberGeneratorMock;
private readonly Mock<ITenantUniqueNumberGenerator> _uniqueNumberGeneratorMock;
private readonly Mock<IDynamicPropertyService> _dynamicPropertyServiceMock;
private readonly IPlatformMemoryCache _platformMemoryCache;
private readonly Mock<IChangeLogService> _changeLogServiceMock;
Expand All @@ -64,7 +64,7 @@ public CustomerOrderServiceImplIntegrationTests()
_paymentMethodRegistrarMock = new Mock<IPaymentMethodsRegistrar>();
_paymentMethodsSearchService = new Mock<IPaymentMethodsSearchService>();
_paymentMethodsSearchService.Setup(s => s.SearchAsync(It.IsAny<PaymentMethodsSearchCriteria>(), It.IsAny<bool>())).ReturnsAsync(new PaymentMethodsSearchResult());
_uniqueNumberGeneratorMock = new Mock<IUniqueNumberGenerator>();
_uniqueNumberGeneratorMock = new Mock<ITenantUniqueNumberGenerator>();
_customerOrderTotalsCalculatorMock = new Mock<ICustomerOrderTotalsCalculator>();
_dynamicPropertyServiceMock = new Mock<IDynamicPropertyService>();
_cacheEntryMock = new Mock<ICacheEntry>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public class CustomerOrderServiceUnitTests
{
private readonly Mock<IUnitOfWork> _unitOfWorkMock;
private readonly Mock<IOrderRepository> _orderRepositoryMock;
private readonly Mock<IUniqueNumberGenerator> _uniqueNumberGeneratorMock;
private readonly Mock<ITenantUniqueNumberGenerator> _uniqueNumberGeneratorMock;
private readonly Mock<IStoreService> _storeServiceMock;
private readonly Mock<IEventPublisher> _eventPublisherMock;
private readonly Mock<ICustomerOrderTotalsCalculator> _customerOrderTotalsCalculatorMock;
Expand All @@ -43,7 +43,7 @@ public CustomerOrderServiceUnitTests()
{
_unitOfWorkMock = new Mock<IUnitOfWork>();
_orderRepositoryMock = new Mock<IOrderRepository>();
_uniqueNumberGeneratorMock = new Mock<IUniqueNumberGenerator>();
_uniqueNumberGeneratorMock = new Mock<ITenantUniqueNumberGenerator>();
_storeServiceMock = new Mock<IStoreService>();
_eventPublisherMock = new Mock<IEventPublisher>();
_customerOrderTotalsCalculatorMock = new Mock<ICustomerOrderTotalsCalculator>();
Expand Down

0 comments on commit a4d8480

Please sign in to comment.