fix: finish received transfers after relabel settlement
This commit is contained in:
+18
@@ -1164,6 +1164,24 @@ class RelabelApplicationServiceTest {
|
||||
verify(inventoryCommands, never()).release(any(), any(), any());
|
||||
}
|
||||
|
||||
@Test
|
||||
void receivedTransferAfterPdaSettlementCompletesWithoutDuplicateFinancialCommands() {
|
||||
RelabelApplication app = transferCompletionFixture();
|
||||
for (String walletStatus : List.of("SETTLE_PENDING", "SETTLED")) {
|
||||
app.setStatus(RelabelApplicationService.READY_FOR_OUTBOUND); app.setFulfillmentStatus("OUTBOUNDED");
|
||||
app.setWalletStatus(walletStatus);
|
||||
service.completeWarehouseTransferFulfillment("10001", app.getRelabelNo(), 91L, "operator-1");
|
||||
service.completeWarehouseTransferFulfillment("10001", app.getRelabelNo(), 91L, "operator-1");
|
||||
assertEquals("COMPLETED", app.getStatus()); assertEquals("COMPLETED", app.getFulfillmentStatus());
|
||||
assertEquals(walletStatus, app.getWalletStatus());
|
||||
}
|
||||
verify(histories, times(2)).insert(any(RelabelStatusHistory.class));
|
||||
verify(feeSources, never()).publishApproved(any(), any(), any());
|
||||
verify(walletCommands, never()).publish(any(), anyLong(), any(), any(), any(), any(), anyLong());
|
||||
verify(inventoryCommands, never()).release(any(), any(), any());
|
||||
verify(inventoryCommands, never()).releaseTransferRelabel(any(), any(), any(), any(), any());
|
||||
}
|
||||
|
||||
@Test
|
||||
void transferCompletionRejectsWrongLinkUnreceivedStockMissingConfirmationOrFailedFreeze() {
|
||||
RelabelApplication app = transferCompletionFixture();
|
||||
|
||||
Reference in New Issue
Block a user