File tree Expand file tree Collapse file tree
Ordering.API/Application/Sagas
Ordering.Domain/AggregatesModel/OrderAggregate Expand file tree Collapse file tree Original file line number Diff line number Diff 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 ;
Original file line number Diff line number Diff 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
You can’t perform that action at this time.
0 commit comments