Skip to content

Commit

Permalink
Address latest code review notes
Browse files Browse the repository at this point in the history
  • Loading branch information
vlaskhilkevich committed Jul 26, 2024
1 parent 36a731c commit 92cc0db
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -321,8 +321,8 @@ private InvoiceItem createTaxInvoiceItem(final InvoiceItem taxableItem, final UU
}

if (taxRate == null) {
logger.info("The tax rate is not provided in the Vertex response for the tax item with ID: {} and calculated tax: {}", taxItem.getId(), calculatedTax);
taxRate = calculatedTax.divide(taxableItem.getAmount(), 5, RoundingMode.HALF_UP).doubleValue();
logger.warn("The tax rate is not provided in the Vertex response for the tax item with ID: {} and calculated tax: {}", taxItem.getId(), calculatedTax);
taxRate = calculatedTax.divide(taxableItem.getAmount(), 5, RoundingMode.HALF_DOWN).doubleValue();
}

final String taxItemDetails = createTaxItemDetails(ImmutableMap.of("taxRate", taxRate));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,6 @@ public void beforeMethod() throws Exception {

given(responseLineItem.getLineItemId()).willReturn(TAX_ITEM_ID.toString());
given(responseLineItem.getTotalTax()).willReturn(MOCK_TAX_AMOUNT_1_01);
given(responseLineItem.getTotalTax()).willReturn(MOCK_TAX_AMOUNT_1_01);

given(vertexApiClient.calculateTaxes(any(SaleRequestType.class))).willReturn(taxResponse);
given(taxResponse.getData()).willReturn(apiResponseData);
Expand Down

0 comments on commit 92cc0db

Please sign in to comment.