提交
This commit is contained in:
+18
@@ -472,6 +472,24 @@ class InboundPdaWorkflowServiceTest {
|
||||
assertEquals("PARTIAL_INBOUND", plan.getStatus());
|
||||
verify(stockReceipts).stockIn(eq("100"), eq(plan), eq(task), eq(List.of(targetLine)),
|
||||
eq(List.of(target)), eq(List.of(targetPallet)), any(), eq(true));
|
||||
verify(unloadCompletedOutbox).publish(eq(plan), eq(task), eq(List.of(101L)));
|
||||
}
|
||||
|
||||
@Test
|
||||
void partialCompleteRequiresUnloadPhotosBeforeStockIn() {
|
||||
target.setPickedPackageCount(2);
|
||||
task.setUnloadPhotoFileIds(null);
|
||||
task.setUnloadPhotoUploadedAt(null);
|
||||
task.setEstimatedEmptyReturnAt(null);
|
||||
activeTask();
|
||||
|
||||
ResponseStatusException exception = assertThrows(ResponseStatusException.class,
|
||||
() -> service.partialComplete("100", "LIP1",
|
||||
new PdaRequests.ForceComplete("partial-no-photo", "7", "worker")));
|
||||
|
||||
assertEquals(409, exception.getStatusCode().value());
|
||||
verify(stockReceipts, never()).stockIn(any(), any(), any(), any(), any(), any(), any(), eq(true));
|
||||
verify(unloadCompletedOutbox, never()).publish(any(), any(), any());
|
||||
}
|
||||
|
||||
@Test
|
||||
|
||||
+18
@@ -179,6 +179,24 @@ class InboundStockReceiptServiceTest {
|
||||
assertEquals(10L, activationReceipts.getValue().get(0).getInventoryPositionId());
|
||||
}
|
||||
|
||||
@Test
|
||||
void partialStockInSynchronizesOrderWithoutActivatingDropship() {
|
||||
Fixture fixture = fixture(5, 2, 2, 10);
|
||||
fixture.order.setOrderType("ONE_CLICK_DROPSHIP");
|
||||
when(orders.selectBatchIds(any())).thenReturn(List.of(fixture.order));
|
||||
when(inventory.stockIn(eq("100"), eq("operator"), any(InventoryCommandRequests.StockIn.class)))
|
||||
.thenReturn(new InventoryCommandResponse(8L, "STOCK_IN", 9L, 10L, 2, 0, 0, 0, false, false));
|
||||
|
||||
service.stockIn("100", fixture.plan, fixture.task, List.of(fixture.line),
|
||||
List.of(fixture.allocation), List.of(fixture.pallet), LocalDateTime.now(), true);
|
||||
|
||||
assertEquals("INBOUND_COMPLETED", fixture.order.getCurrentStatus());
|
||||
assertEquals("INBOUND_PLAN:PARTIAL_INBOUND", fixture.order.getSubOrderStatus());
|
||||
verify(orders).updateById(fixture.order);
|
||||
verify(orderHistories).insert(any(LastlegOrderStatusHistory.class));
|
||||
verify(dropshipOrders, never()).activateAfterStockIn(any(), any(), any(), any());
|
||||
}
|
||||
|
||||
private Fixture fixture(int required, int planned, int picked, int quantity) {
|
||||
InboundPlan plan = new InboundPlan(); plan.setId(1L); plan.setPlanNo("IP-1");
|
||||
InboundPdaTask task = new InboundPdaTask(); task.setId(2L); task.setOperatorId("operator");
|
||||
|
||||
Reference in New Issue
Block a user