From 3f80f18cfddbcd75745c54d42daf5ca14cd4d162 Mon Sep 17 00:00:00 2001 From: Konstantin Savosteev Date: Mon, 11 Sep 2023 08:21:49 +0200 Subject: [PATCH] fix: remove obsolete methods --- .../Services/CustomerOrderService.cs | 7 ++++++- .../Controllers/Api/OrderModuleController.cs | 8 ++------ 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/src/VirtoCommerce.OrdersModule.Data/Services/CustomerOrderService.cs b/src/VirtoCommerce.OrdersModule.Data/Services/CustomerOrderService.cs index ba862e03..9dc0a9b6 100644 --- a/src/VirtoCommerce.OrdersModule.Data/Services/CustomerOrderService.cs +++ b/src/VirtoCommerce.OrdersModule.Data/Services/CustomerOrderService.cs @@ -235,7 +235,12 @@ protected virtual async Task EnsureThatAllOperationsHaveNumber(CustomerOrder ord var numberTemplate = opType + "{0:yyMMdd}-{1:D5}"; if (store != null) { - numberTemplate = store.Settings.GetSettingValue("Order." + objectTypeName + "NewNumberTemplate", numberTemplate); + var descriptor = new SettingDescriptor + { + Name = "Order." + objectTypeName + "NewNumberTemplate", + DefaultValue = numberTemplate, + }; + numberTemplate = store.Settings.GetValue(descriptor); } operation.Number = _uniqueNumberGenerator.GenerateNumber(numberTemplate); diff --git a/src/VirtoCommerce.OrdersModule.Web/Controllers/Api/OrderModuleController.cs b/src/VirtoCommerce.OrdersModule.Web/Controllers/Api/OrderModuleController.cs index cc02f643..d8e5f864 100644 --- a/src/VirtoCommerce.OrdersModule.Web/Controllers/Api/OrderModuleController.cs +++ b/src/VirtoCommerce.OrdersModule.Web/Controllers/Api/OrderModuleController.cs @@ -414,9 +414,7 @@ public async Task> GetNewShipment(string id) retVal.Status = "New"; var store = await _storeService.GetNoCloneAsync(order.StoreId, StoreResponseGroup.StoreInfo.ToString()); - var numberTemplate = store.Settings.GetSettingValue( - ModuleConstants.Settings.General.OrderShipmentNewNumberTemplate.Name, - ModuleConstants.Settings.General.OrderShipmentNewNumberTemplate.DefaultValue); + var numberTemplate = store.Settings.GetValue(ModuleConstants.Settings.General.OrderShipmentNewNumberTemplate); retVal.Number = _uniqueNumberGenerator.GenerateNumber(numberTemplate.ToString()); return Ok(retVal); @@ -453,9 +451,7 @@ public async Task> GetNewPayment(string id) retVal.Status = retVal.PaymentStatus.ToString(); var store = await _storeService.GetNoCloneAsync(order.StoreId, StoreResponseGroup.StoreInfo.ToString()); - var numberTemplate = store.Settings.GetSettingValue( - ModuleConstants.Settings.General.OrderPaymentInNewNumberTemplate.Name, - ModuleConstants.Settings.General.OrderPaymentInNewNumberTemplate.DefaultValue); + var numberTemplate = store.Settings.GetValue(ModuleConstants.Settings.General.OrderPaymentInNewNumberTemplate); retVal.Number = _uniqueNumberGenerator.GenerateNumber(numberTemplate.ToString()); return Ok(retVal); }