|
|
@ -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
|
|
|
|
|
|
|
|