fix(firstleg): price dropship before preload confirmation

This commit is contained in:
2026-09-09 03:11:41 +08:00
parent c5862db98d
commit bf89a04883
7 changed files with 31 additions and 10 deletions
@@ -316,6 +316,24 @@ class FbaPricingServiceTest {
verify(priceBookEstimator).estimate(eq(TENANT), any());
}
@Test
@DisplayName("一件代发待合托状态允许初算且不改变作业状态")
void calculatesDropshipFeeWhileWaitingForPalletization() {
readyRepository();
InboundPricingEntity inbound = inbound("10", "1");
inbound.setProcessStatus("WAIT_PALLETIZE");
when(repository.findInbound(TENANT, INBOUND)).thenReturn(inbound);
when(priceBookEstimator.estimate(anyLong(), any())).thenReturn(
estimate("CBM", "1.0000", "10", "10", "0"));
FeeSnapshotResponse response = service.calculate(
TENANT, OPERATOR, INBOUND, NOW, "dropship-initial-pricing");
assertThat(response.nextProcessStatus()).isEqualTo("WAIT_PALLETIZE");
verify(repository).markInboundCalculated(TENANT, INBOUND, "WAIT_PALLETIZE", "CBM",
new BigDecimal("1.0000"));
}
@Test
@DisplayName("客户未确认时待装柜订单可重新计算并替换已发送费用")
void recalculatesSentFeeBeforeCustomerConfirmation() {