fix(firstleg): persist pricing conversion metadata
This commit is contained in:
@@ -84,6 +84,9 @@ class FbaPricingServiceTest {
|
||||
assertThat(response.totalAmount()).isEqualByComparingTo("401.77");
|
||||
assertThat(response.priceBookVersionId()).isEqualTo(701L);
|
||||
assertThat(response.pricingTaxMode()).isEqualTo("TAX_INCLUDED");
|
||||
assertThat(response.conversionFactor()).isEqualByComparingTo("167");
|
||||
assertThat(response.roundingScale()).isEqualTo(6);
|
||||
assertThat(response.roundingMode()).isEqualTo("HALF_UP");
|
||||
assertThat(response.nextProcessStatus()).isEqualTo("FEE_CONFIRMING");
|
||||
ArgumentCaptor<InboundFeeEntity> fee = ArgumentCaptor.forClass(InboundFeeEntity.class);
|
||||
verify(repository).insertFee(fee.capture());
|
||||
@@ -92,6 +95,9 @@ class FbaPricingServiceTest {
|
||||
assertThat(fee.getValue().getChargeRuleId()).isNull();
|
||||
assertThat(fee.getValue().getCarrierId()).isNull();
|
||||
assertThat(fee.getValue().getCustomerId()).isEqualTo(11L);
|
||||
assertThat(fee.getValue().getConversionFactor()).isEqualByComparingTo("167");
|
||||
assertThat(fee.getValue().getRoundingScale()).isEqualTo(6);
|
||||
assertThat(fee.getValue().getRoundingMode()).isEqualTo("HALF_UP");
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -125,6 +131,9 @@ class FbaPricingServiceTest {
|
||||
assertThat(response.convertedQuantity()).isEqualByComparingTo("1.0001");
|
||||
assertThat(response.chargeableQuantity()).isEqualByComparingTo("1.0001");
|
||||
assertThat(response.totalAmount()).isEqualByComparingTo("100.01");
|
||||
assertThat(response.conversionFactor()).isEqualByComparingTo("363");
|
||||
assertThat(response.roundingScale()).isEqualTo(6);
|
||||
assertThat(response.roundingMode()).isEqualTo("HALF_UP");
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -464,7 +473,8 @@ class FbaPricingServiceTest {
|
||||
rate.setAdditionalFee(new BigDecimal(additional)); rate.setEffectiveFrom(NOW.minusDays(1));
|
||||
return new ActivePriceBookEstimator.Estimate(701L, "MATSON_TRUCK", PriceModel.FBA_WAREHOUSE_RATE,
|
||||
PricingTaxMode.TAX_INCLUDED, rate, new BigDecimal(quantity), unit,
|
||||
new BigDecimal(price), new BigDecimal(amount), "USD");
|
||||
new BigDecimal(price), new BigDecimal(amount), "USD",
|
||||
"KG".equals(unit) ? new BigDecimal("167") : new BigDecimal("363"), 6, "HALF_UP");
|
||||
}
|
||||
|
||||
private InboundPricingIdempotencyEntity completed(String operation, long feeId) {
|
||||
|
||||
Reference in New Issue
Block a user