Browse Source

Removed SetAsShippedDto

After separating the Update action it was unnecessary, so removed it and its dependencies
pull/92/head
malik masis 4 years ago
parent
commit
edcc3688cb
  1. 2
      services/ordering/src/EShopOnAbp.OrderingService.Application.Contracts/Orders/IOrderAppService.cs
  2. 1
      services/ordering/src/EShopOnAbp.OrderingService.Application.Contracts/Orders/SetAsCancelledDto.cs
  3. 9
      services/ordering/src/EShopOnAbp.OrderingService.Application.Contracts/Orders/SetAsShippedDto.cs
  4. 4
      services/ordering/src/EShopOnAbp.OrderingService.Application/Orders/OrderAppService.cs
  5. 6
      services/ordering/src/EShopOnAbp.OrderingService.Domain/Orders/Order.cs
  6. 5
      services/ordering/src/EShopOnAbp.OrderingService.HttpApi.Client/ClientProxies/OrderClientProxy.Generated.cs
  7. 24
      services/ordering/src/EShopOnAbp.OrderingService.HttpApi.Client/ClientProxies/ordering-generate-proxy.json

2
services/ordering/src/EShopOnAbp.OrderingService.Application.Contracts/Orders/IOrderAppService.cs

@ -14,7 +14,7 @@ public interface IOrderAppService : IApplicationService
Task<List<OrderDto>> GetOrdersAsync(GetOrdersInput input);
Task<OrderDto> GetByOrderNoAsync(int orderNo);
Task SetAsCancelledAsync(Guid id, SetAsCancelledDto input);
Task SetAsShippedAsync(Guid id, SetAsShippedDto input);
Task SetAsShippedAsync(Guid id);
Task<PagedResultDto<OrderDto>> GetListPagedAsync(PagedAndSortedResultRequestDto input);
}

1
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; }
}

9
services/ordering/src/EShopOnAbp.OrderingService.Application.Contracts/Orders/SetAsShippedDto.cs

@ -1,9 +0,0 @@
using System;
namespace EShopOnAbp.OrderingService.Orders
{
public class SetAsShippedDto
{
public int OrderStatusId { get; set; }
}
}

4
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);
}

6
services/ordering/src/EShopOnAbp.OrderingService.Domain/Orders/Order.cs

@ -97,12 +97,8 @@ public class Order : AggregateRoot<Guid>
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;

5
services/ordering/src/EShopOnAbp.OrderingService.HttpApi.Client/ClientProxies/OrderClientProxy.Generated.cs

@ -65,12 +65,11 @@ public partial class OrderClientProxy : ClientProxyBase<IOrderAppService>, 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 }
});
}

24
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": {

Loading…
Cancel
Save