File tree 1 file changed +8
-2
lines changed
server/service/src/processors/transfer/shipment
1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -26,9 +26,11 @@ impl ShipmentTransferProcessor for UpdateOutboundShipmentStatusProcessor {
26
26
/// 3. Linked shipment exists (the outbound shipment)
27
27
/// 4. Linked outbound shipment status is not Verified (this is the last status possible)
28
28
/// 5. Linked outbound shipment status is not source inbound shipment status
29
+ /// 6. Source shipment is from mSupply thus the status will be `New`. Shouldn't happen for OMS since
30
+ /// OMS will follow OMS status sequence
29
31
///
30
32
/// Can only run two times (one for Delivered and one for Verified status):
31
- /// 6 . Because linked outbound shipment status will be updated to source inbound shipment status and `5.` will never be true again
33
+ /// 7 . Because linked outbound shipment status will be updated to source inbound shipment status and `5.` will never be true again
32
34
/// and business rules guarantee that Inbound shipment can only change status to Delivered and Verified
33
35
/// and status cannot be changed backwards
34
36
fn try_process_record (
@@ -62,10 +64,14 @@ impl ShipmentTransferProcessor for UpdateOutboundShipmentStatusProcessor {
62
64
if outbound_shipment. invoice_row . status == inbound_shipment. invoice_row . status {
63
65
return Ok ( None ) ;
64
66
}
67
+ // 6.
68
+ if inbound_shipment. invoice_row . status == InvoiceRowStatus :: New {
69
+ return Ok ( None ) ;
70
+ }
65
71
66
72
// Execute
67
73
let updated_outbound_shipment = InvoiceRow {
68
- // 6 .
74
+ // 7 .
69
75
status : inbound_shipment. invoice_row . status . clone ( ) ,
70
76
delivered_datetime : inbound_shipment. invoice_row . delivered_datetime . clone ( ) ,
71
77
verified_datetime : inbound_shipment. invoice_row . verified_datetime . clone ( ) ,
You can’t perform that action at this time.
0 commit comments