Browse Source

Merge branch 'order-processflow-redesign' of https://github.com/dotnet-architecture/eShopOnContainers into order-processflow-redesign

# Conflicts:
#	src/Services/Ordering/Ordering.Domain/AggregatesModel/OrderAggregate/Order.cs
pull/809/head
Christian Arenas 7 years ago
parent
commit
504efbd191
2 changed files with 7 additions and 15 deletions
  1. +1
    -1
      src/Services/Ordering/Ordering.API/Application/Sagas/OrderProcessSaga.cs
  2. +6
    -14
      src/Services/Ordering/Ordering.Domain/AggregatesModel/OrderAggregate/Order.cs

+ 1
- 1
src/Services/Ordering/Ordering.API/Application/Sagas/OrderProcessSaga.cs View File

@ -73,7 +73,7 @@ namespace Ordering.API.Application.Sagas
if (orderSaga.GetOrderStatusId() != OrderStatus.Cancelled.Id
|| orderSaga.GetOrderStatusId() != OrderStatus.Shipped.Id)
{
orderSaga.SetCancelStatus();
orderSaga.SetCancelledStatus();
result = await SaveChangesAsync();
}
return result;


+ 6
- 14
src/Services/Ordering/Ordering.Domain/AggregatesModel/OrderAggregate/Order.cs View File

@ -170,35 +170,27 @@ namespace Microsoft.eShopOnContainers.Services.Ordering.Domain.AggregatesModel.O
{
if (_orderStatusId == OrderStatus.Submited.Id)
{
_description = "";
_description = "The order was cancelled before the grace period was confirm.";
}
else if (_orderStatusId == OrderStatus.AwaitingValidation.Id)
{
_description = "";
_description = "The order was cancelled before to check the order stock items.";
}
else if (_orderStatusId == OrderStatus.StockConfirmed.Id)
{
_description = "";
_description = "The order was cancelled before to pay the order.";
}
else if (_orderStatusId == OrderStatus.Paid.Id)
{
_description = "";
_description = "The order was cancelled before to ship the order.";
}
else if(_orderStatusId == OrderStatus.Shipped.Id)
{
throw new OrderingDomainException("Not possible to change order status. Reason: cannot cancel order it is already shipped");
throw new OrderingDomainException("Not possible to change order status. Reason: cannot cancel order it is already shipped.");
}
_orderStatusId = OrderStatus.Cancelled.Id;
}
public void SetCancelStatus()
{
if (_orderStatusId == OrderStatus.Shipped.Id)
{
throw new OrderingDomainException("Not possible to change order status. Reason: cannot cancel order it is already shipped");
}
_orderStatusId = OrderStatus.Cancelled.Id;
}
}
#endregion


Loading…
Cancel
Save