test: automate overseas wallet and pallet cost closure

This commit is contained in:
2026-09-06 11:00:06 +08:00
parent 64bf5aa0fe
commit 20b3074cb1
21 changed files with 506 additions and 103 deletions
@@ -7,6 +7,11 @@ import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.assertThatThrownBy;
class DestuffingPalletCostServiceTest {
@Test void newestCompletedBookingsAreNotStarvedByOldUnbillableRows() {
assertThat(DestuffingPalletCostService.READY_BOOKINGS_SQL)
.contains("ORDER BY MAX(t.completed_at) DESC LIMIT 50")
.doesNotContain("ORDER BY MIN(t.completed_at)");
}
@Test void preservesTotalAndLetsFinalCustomerAbsorbRoundingRemainder() {
List<BigDecimal> result = DestuffingPalletCostService.allocate(new BigDecimal("10.00"),
List.of(new BigDecimal("1"), new BigDecimal("1"), new BigDecimal("1")));