fix: support id-only overseas destinations
This commit is contained in:
+16
@@ -92,6 +92,22 @@ class InventoryCommandServiceTest {
|
||||
verify(ledgers).insert(any(InventoryLedger.class));
|
||||
}
|
||||
|
||||
@Test
|
||||
void registersIdOnlyOverseasDestinationWithoutInventingAWarehouseCode() {
|
||||
when(balances.lockDimension("100", "WH-1", "", 101L, "IN-CODE-1")).thenReturn(null);
|
||||
InventoryCommandRequests.InTransit request = new InventoryCommandRequests.InTransit(
|
||||
"Customer 100", "WH-1", "WH1", "Warehouse 1", "DEST-OVERSEAS", null,
|
||||
"New York warehouse", 101L, "IN-1", "IN-CODE-1", "SKU-1", "Product 1", null,
|
||||
1, "ORD-1", "EVT-1", "transit-id-only", null);
|
||||
|
||||
service.registerInTransit("100", "SYSTEM", request);
|
||||
|
||||
ArgumentCaptor<InventoryBalance> inserted = ArgumentCaptor.forClass(InventoryBalance.class);
|
||||
verify(balances).insert(inserted.capture());
|
||||
assertEquals("DEST-OVERSEAS", inserted.getValue().getDestinationWarehouseId());
|
||||
assertEquals("", inserted.getValue().getDestinationWarehouseCode());
|
||||
}
|
||||
|
||||
@Test
|
||||
void stockInTransfersPackagesFromInTransitToAvailable() {
|
||||
InventoryBalance balance = balance(200L, 0);
|
||||
|
||||
Reference in New Issue
Block a user