Skip to content

Commit ca56f63

Browse files
committed
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
1 parent 94ee95f commit ca56f63

2 files changed

Lines changed: 7 additions & 15 deletions

File tree

src/Services/Ordering/Ordering.API/Application/Sagas/OrderProcessSaga.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ public async Task<bool> Handle(CancelOrderCommand command)
7373
if (orderSaga.GetOrderStatusId() != OrderStatus.Cancelled.Id
7474
|| orderSaga.GetOrderStatusId() != OrderStatus.Shipped.Id)
7575
{
76-
orderSaga.SetCancelStatus();
76+
orderSaga.SetCancelledStatus();
7777
result = await SaveChangesAsync();
7878
}
7979
return result;

src/Services/Ordering/Ordering.Domain/AggregatesModel/OrderAggregate/Order.cs

Lines changed: 6 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -170,35 +170,27 @@ public void SetCancelledStatus()
170170
{
171171
if (_orderStatusId == OrderStatus.Submited.Id)
172172
{
173-
_description = "";
173+
_description = "The order was cancelled before the grace period was confirm.";
174174
}
175175
else if (_orderStatusId == OrderStatus.AwaitingValidation.Id)
176176
{
177-
_description = "";
177+
_description = "The order was cancelled before to check the order stock items.";
178178
}
179179
else if (_orderStatusId == OrderStatus.StockConfirmed.Id)
180180
{
181-
_description = "";
181+
_description = "The order was cancelled before to pay the order.";
182182
}
183183
else if (_orderStatusId == OrderStatus.Paid.Id)
184184
{
185-
_description = "";
185+
_description = "The order was cancelled before to ship the order.";
186186
}
187187
else if(_orderStatusId == OrderStatus.Shipped.Id)
188188
{
189-
throw new OrderingDomainException("Not possible to change order status. Reason: cannot cancel order it is already shipped");
189+
throw new OrderingDomainException("Not possible to change order status. Reason: cannot cancel order it is already shipped.");
190190
}
191-
_orderStatusId = OrderStatus.Cancelled.Id;
192-
}
193191

194-
public void SetCancelStatus()
195-
{
196-
if (_orderStatusId == OrderStatus.Shipped.Id)
197-
{
198-
throw new OrderingDomainException("Not possible to change order status. Reason: cannot cancel order it is already shipped");
199-
}
200192
_orderStatusId = OrderStatus.Cancelled.Id;
201-
}
193+
}
202194

203195
#endregion
204196

0 commit comments

Comments
 (0)