diff --git a/services/ordering/src/EShopOnAbp.OrderingService.Application.Contracts/Orders/IOrderAppService.cs b/services/ordering/src/EShopOnAbp.OrderingService.Application.Contracts/Orders/IOrderAppService.cs index d04e7685..90dd07f2 100644 --- a/services/ordering/src/EShopOnAbp.OrderingService.Application.Contracts/Orders/IOrderAppService.cs +++ b/services/ordering/src/EShopOnAbp.OrderingService.Application.Contracts/Orders/IOrderAppService.cs @@ -14,7 +14,7 @@ public interface IOrderAppService : IApplicationService Task> GetOrdersAsync(GetOrdersInput input); Task GetByOrderNoAsync(int orderNo); Task SetAsCancelledAsync(Guid id, SetAsCancelledDto input); - Task SetAsShippedAsync(Guid id, SetAsShippedDto input); + Task SetAsShippedAsync(Guid id); Task> GetListPagedAsync(PagedAndSortedResultRequestDto input); } \ No newline at end of file diff --git a/services/ordering/src/EShopOnAbp.OrderingService.Application.Contracts/Orders/SetAsCancelledDto.cs b/services/ordering/src/EShopOnAbp.OrderingService.Application.Contracts/Orders/SetAsCancelledDto.cs index 4f61d28a..f0cd0783 100644 --- a/services/ordering/src/EShopOnAbp.OrderingService.Application.Contracts/Orders/SetAsCancelledDto.cs +++ b/services/ordering/src/EShopOnAbp.OrderingService.Application.Contracts/Orders/SetAsCancelledDto.cs @@ -4,7 +4,6 @@ namespace EShopOnAbp.OrderingService.Orders { public class SetAsCancelledDto { - public int OrderStatusId { get; set; } public Guid PaymentRequestId { get; set; } public string PaymentRequestStatus { get; set; } } diff --git a/services/ordering/src/EShopOnAbp.OrderingService.Application.Contracts/Orders/SetAsShippedDto.cs b/services/ordering/src/EShopOnAbp.OrderingService.Application.Contracts/Orders/SetAsShippedDto.cs deleted file mode 100644 index ff6eb986..00000000 --- a/services/ordering/src/EShopOnAbp.OrderingService.Application.Contracts/Orders/SetAsShippedDto.cs +++ /dev/null @@ -1,9 +0,0 @@ -using System; - -namespace EShopOnAbp.OrderingService.Orders -{ - public class SetAsShippedDto - { - public int OrderStatusId { get; set; } - } -} \ No newline at end of file diff --git a/services/ordering/src/EShopOnAbp.OrderingService.Application/Orders/OrderAppService.cs b/services/ordering/src/EShopOnAbp.OrderingService.Application/Orders/OrderAppService.cs index ea4faeef..6ba22894 100644 --- a/services/ordering/src/EShopOnAbp.OrderingService.Application/Orders/OrderAppService.cs +++ b/services/ordering/src/EShopOnAbp.OrderingService.Application/Orders/OrderAppService.cs @@ -85,10 +85,10 @@ public class OrderAppService : ApplicationService, IOrderAppService } [Authorize(OrderingServicePermissions.Orders.SetAsShipped)] - public async Task SetAsShippedAsync(Guid id, SetAsShippedDto input) + public async Task SetAsShippedAsync(Guid id) { var order = await _orderRepository.GetAsync(id); - order.SetOrderAsShipped(input.OrderStatusId); + order.SetOrderAsShipped(); await _orderRepository.UpdateAsync(order); } diff --git a/services/ordering/src/EShopOnAbp.OrderingService.Domain/Orders/Order.cs b/services/ordering/src/EShopOnAbp.OrderingService.Domain/Orders/Order.cs index 802ec1a9..2be38367 100644 --- a/services/ordering/src/EShopOnAbp.OrderingService.Domain/Orders/Order.cs +++ b/services/ordering/src/EShopOnAbp.OrderingService.Domain/Orders/Order.cs @@ -97,12 +97,8 @@ public class Order : AggregateRoot return OrderItems.Sum(o => o.Units * o.UnitPrice); } - public Order SetOrderAsShipped(int orderStatus) + public Order SetOrderAsShipped() { - if (orderStatus == OrderStatus.Cancelled.Id) - { - return this; - } //TODO no enough to update the object. _orderStatusId = OrderStatus.Shipped.Id; return this; diff --git a/services/ordering/src/EShopOnAbp.OrderingService.HttpApi.Client/ClientProxies/OrderClientProxy.Generated.cs b/services/ordering/src/EShopOnAbp.OrderingService.HttpApi.Client/ClientProxies/OrderClientProxy.Generated.cs index 466eb65e..f51841db 100644 --- a/services/ordering/src/EShopOnAbp.OrderingService.HttpApi.Client/ClientProxies/OrderClientProxy.Generated.cs +++ b/services/ordering/src/EShopOnAbp.OrderingService.HttpApi.Client/ClientProxies/OrderClientProxy.Generated.cs @@ -65,12 +65,11 @@ public partial class OrderClientProxy : ClientProxyBase, IOrde }); } - public virtual async Task SetAsShippedAsync(Guid id, SetAsShippedDto input) + public virtual async Task SetAsShippedAsync(Guid id) { await RequestAsync(nameof(SetAsShippedAsync), new ClientProxyRequestTypeValue { - { typeof(Guid), id }, - { typeof(SetAsShippedDto), input } + { typeof(Guid), id } }); } diff --git a/services/ordering/src/EShopOnAbp.OrderingService.HttpApi.Client/ClientProxies/ordering-generate-proxy.json b/services/ordering/src/EShopOnAbp.OrderingService.HttpApi.Client/ClientProxies/ordering-generate-proxy.json index 3e8f9f1c..f437165f 100644 --- a/services/ordering/src/EShopOnAbp.OrderingService.HttpApi.Client/ClientProxies/ordering-generate-proxy.json +++ b/services/ordering/src/EShopOnAbp.OrderingService.HttpApi.Client/ClientProxies/ordering-generate-proxy.json @@ -289,8 +289,8 @@ "allowAnonymous": false, "implementFrom": "EShopOnAbp.OrderingService.Orders.IOrderAppService" }, - "SetAsShippedAsyncByIdAndInput": { - "uniqueName": "SetAsShippedAsyncByIdAndInput", + "SetAsShippedAsyncById": { + "uniqueName": "SetAsShippedAsyncById", "name": "SetAsShippedAsync", "httpMethod": "POST", "url": "api/ordering/order/{id}/set-as-shipped", @@ -303,14 +303,6 @@ "typeSimple": "string", "isOptional": false, "defaultValue": null - }, - { - "name": "input", - "typeAsString": "EShopOnAbp.OrderingService.Orders.SetAsShippedDto, EShopOnAbp.OrderingService.Application.Contracts", - "type": "EShopOnAbp.OrderingService.Orders.SetAsShippedDto", - "typeSimple": "EShopOnAbp.OrderingService.Orders.SetAsShippedDto", - "isOptional": false, - "defaultValue": null } ], "parameters": [ @@ -325,18 +317,6 @@ "constraintTypes": [], "bindingSourceId": "Path", "descriptorName": "" - }, - { - "nameOnMethod": "input", - "name": "input", - "jsonName": null, - "type": "EShopOnAbp.OrderingService.Orders.SetAsShippedDto", - "typeSimple": "EShopOnAbp.OrderingService.Orders.SetAsShippedDto", - "isOptional": false, - "defaultValue": null, - "constraintTypes": null, - "bindingSourceId": "Body", - "descriptorName": "" } ], "returnValue": {