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
This commit is contained in:
parent
db41124d78
commit
504efbd191
@ -73,7 +73,7 @@ namespace Ordering.API.Application.Sagas
|
|||||||
if (orderSaga.GetOrderStatusId() != OrderStatus.Cancelled.Id
|
if (orderSaga.GetOrderStatusId() != OrderStatus.Cancelled.Id
|
||||||
|| orderSaga.GetOrderStatusId() != OrderStatus.Shipped.Id)
|
|| orderSaga.GetOrderStatusId() != OrderStatus.Shipped.Id)
|
||||||
{
|
{
|
||||||
orderSaga.SetCancelStatus();
|
orderSaga.SetCancelledStatus();
|
||||||
result = await SaveChangesAsync();
|
result = await SaveChangesAsync();
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
|
@ -170,36 +170,28 @@ namespace Microsoft.eShopOnContainers.Services.Ordering.Domain.AggregatesModel.O
|
|||||||
{
|
{
|
||||||
if (_orderStatusId == OrderStatus.Submited.Id)
|
if (_orderStatusId == OrderStatus.Submited.Id)
|
||||||
{
|
{
|
||||||
_description = "";
|
_description = "The order was cancelled before the grace period was confirm.";
|
||||||
}
|
}
|
||||||
else if (_orderStatusId == OrderStatus.AwaitingValidation.Id)
|
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)
|
else if (_orderStatusId == OrderStatus.StockConfirmed.Id)
|
||||||
{
|
{
|
||||||
_description = "";
|
_description = "The order was cancelled before to pay the order.";
|
||||||
}
|
}
|
||||||
else if (_orderStatusId == OrderStatus.Paid.Id)
|
else if (_orderStatusId == OrderStatus.Paid.Id)
|
||||||
{
|
{
|
||||||
_description = "";
|
_description = "The order was cancelled before to ship the order.";
|
||||||
}
|
}
|
||||||
else if(_orderStatusId == OrderStatus.Shipped.Id)
|
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;
|
_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
|
#endregion
|
||||||
|
|
||||||
public int GetOrderStatusId()
|
public int GetOrderStatusId()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user