fix: deliver actual destuff pallet fees
This commit is contained in:
+8
@@ -7,11 +7,19 @@ import static org.assertj.core.api.Assertions.assertThat;
|
||||
import static org.assertj.core.api.Assertions.assertThatThrownBy;
|
||||
|
||||
class DestuffingPalletCostServiceTest {
|
||||
@Test void publishesDestuffingReceivableAsOverseasContainerBusiness() {
|
||||
assertThat(DestuffingPalletCostService.DESTUFF_BUSINESS_TYPE).isEqualTo("OVERSEAS_CONTAINER");
|
||||
}
|
||||
@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 chargesOnlyPalletsWithPositiveReceivedPackagesAndVolume() {
|
||||
assertThat(DestuffingPalletCostService.RECEIVED_PALLET_IDS_SQL)
|
||||
.contains("pp.actual_package_count>0")
|
||||
.contains("pp.actual_volume_cbm>0");
|
||||
}
|
||||
@Test void preservesTotalAndLetsFinalCustomerAbsorbRoundingRemainder() {
|
||||
List<BigDecimal> result = DestuffingPalletCostService.allocate(new BigDecimal("10.00"),
|
||||
List.of(new BigDecimal("1"), new BigDecimal("1"), new BigDecimal("1")));
|
||||
|
||||
Reference in New Issue
Block a user