Validate if we can create tax item with custom details#41
Open
singh-sukhvir wants to merge 2 commits intomasterfrom
Open
Validate if we can create tax item with custom details#41singh-sukhvir wants to merge 2 commits intomasterfrom
singh-sukhvir wants to merge 2 commits intomasterfrom
Conversation
63f0e93 to
8c3fac3
Compare
singh-sukhvir
commented
Jul 22, 2024
Comment on lines
+303
to
+332
| final InvoiceItem taxItemWithEffectiveRate = transactionLineDetailModel.getEffectiveRate() != null | ||
| ? new PluginInvoiceItem(new Builder<>() | ||
| .withId(taxItem.getId()) | ||
| .withInvoiceItemType(taxItem.getInvoiceItemType()) | ||
| .withInvoiceId(taxItem.getInvoiceId()) | ||
| .withAccountId(taxItem.getAccountId()) | ||
| .withChildAccountId(taxItem.getChildAccountId()) | ||
| .withStartDate(taxItem.getStartDate()) | ||
| .withEndDate(taxItem.getEndDate()) | ||
| .withAmount(taxItem.getAmount()) | ||
| .withCurrency(taxItem.getCurrency()) | ||
| .withDescription(taxItem.getDescription()) | ||
| .withSubscriptionId(taxItem.getSubscriptionId()) | ||
| .withBundleId(taxItem.getBundleId()) | ||
| .withCatalogEffectiveDate(taxItem.getCatalogEffectiveDate()) | ||
| .withProductName(taxItem.getProductName()) | ||
| .withPrettyProductName(taxItem.getPrettyProductName()) | ||
| .withPlanName(taxItem.getPlanName()) | ||
| .withPrettyPlanName(taxItem.getPrettyPlanName()) | ||
| .withPhaseName(taxItem.getPhaseName()) | ||
| .withPrettyPhaseName(taxItem.getPrettyPhaseName()) | ||
| .withRate(taxItem.getRate()) | ||
| .withLinkedItemId(taxItem.getLinkedItemId()) | ||
| .withUsageName(taxItem.getUsageName()) | ||
| .withPrettyUsageName(taxItem.getPrettyUsageName()) | ||
| .withQuantity(taxItem.getQuantity()) | ||
| .withItemDetails(String.valueOf(transactionLineDetailModel.getEffectiveRate())) | ||
| .withCreatedDate(taxItem.getCreatedDate()) | ||
| .withUpdatedDate(taxItem.getUpdatedDate()) | ||
| .validate().build()) |
Contributor
Author
There was a problem hiding this comment.
can we move this to a separate function. Something like below -
final String taxRate = String.valueOf(transactionLineDetailModel.getEffectiveRate())
final InvoiceItem taxItem = createTaxInvoiceItem(taxableItem, invoiceId, adjustmentItem, calculatedTax, description, taxRate)
Contributor
There was a problem hiding this comment.
I think having value "null" as a result of valueOf(null) is not what we want in this case
| .withUsageName(taxItem.getUsageName()) | ||
| .withPrettyUsageName(taxItem.getPrettyUsageName()) | ||
| .withQuantity(taxItem.getQuantity()) | ||
| .withItemDetails(String.valueOf(transactionLineDetailModel.getEffectiveRate())) |
Contributor
Author
There was a problem hiding this comment.
Also, we discussed to save it as json considering we may want to add additional details in future.
Current format won't support that.
Contributor
Author
There was a problem hiding this comment.
@vlaskhilkevich This PR was experimental. Feel free to create a separate PR with your changes.
Contributor
|
@singh-sukhvir this pr can be closed |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.