fix: align phase4 receiving and carrier fixtures
This commit is contained in:
-9
@@ -449,15 +449,6 @@ public class ReceivingContainerService {
|
||||
if (pallet.fbaWarehouseCode() != null && !pallet.fbaWarehouseCode().isBlank()) {
|
||||
throw conflict("FBA-designated pallet cannot receive an OVERSEAS destination carton");
|
||||
}
|
||||
if (ref.line().getDestinationWarehouseId() != null && !ref.line().getDestinationWarehouseId().isBlank()) {
|
||||
try {
|
||||
if (Long.parseLong(ref.line().getDestinationWarehouseId()) != pallet.warehouseId()) {
|
||||
throw conflict("Pallet destination warehouse does not match the inbound code");
|
||||
}
|
||||
} catch (NumberFormatException ignored) {
|
||||
// Destination codes that are not resource IDs are still protected by the actual overseas warehouse check.
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+16
@@ -224,6 +224,22 @@ class ReceivingContainerServiceBehaviorTest {
|
||||
verify(workflow, never()).assignResolvedPallet(any(), any(), any(), any());
|
||||
}
|
||||
|
||||
@Test
|
||||
void overseasPalletUsesActualReceivingWarehouseInsteadOfBusinessDestinationId() {
|
||||
stubCurrent("OVERSEAS", "CONT-A");
|
||||
InboundPlanLine overseasLine = line("OVERSEAS");
|
||||
overseasLine.setDestinationWarehouseId("900");
|
||||
when(lines.selectList(any())).thenReturn(List.of(overseasLine));
|
||||
when(warehouse.resolvePallet("PAL-1")).thenReturn(resource(100L, null));
|
||||
|
||||
var resolved = service.resolvePallet("7",
|
||||
new ReceivingContainerRequests.PalletResolve("PAL-1", "IN-1"));
|
||||
|
||||
assertThat(resolved.compatible()).isTrue();
|
||||
assertThat(resolved.warehouseId()).isEqualTo(100L);
|
||||
assertThat(resolved.destinationType()).isEqualTo("OVERSEAS");
|
||||
}
|
||||
|
||||
@Test
|
||||
void containerCompletionRequiresEveryInboundCodeToBalanceExactly() {
|
||||
stubCurrent("FBA", "CONT-A");
|
||||
|
||||
Reference in New Issue
Block a user