feat(billing): Add sales tax fields to contract and billing protos#286
Open
dashed wants to merge 2 commits into
Open
feat(billing): Add sales tax fields to contract and billing protos#286dashed wants to merge 2 commits into
dashed wants to merge 2 commits into
Conversation
Add a sales_tax field (InvoiceLineItem) to CreateContractRequest and RolloverContractRequest. It carries the pre-computed sales tax (amount in cents plus a label) for the invoice down to Contract, where it is folded into the invoice amount before charge-forgiveness is applied and kept separate from the priced line_items. As a message field, its presence is checked via HasField; unset means no sales tax applies. Add a tax_number field to BillingDetails for the customer's tax registration number (e.g. VAT ID) on file, used upstream when determining the customer's tax treatment. Tax is now computed before the contract request is built and the result is passed down, so Contract no longer needs a tax-id input to compute tax itself. Refs REVENG-15 Co-Authored-By: Claude <noreply@anthropic.com>
|
The latest Buf updates on your PR. Results from workflow ci / buf-checks (pull_request).
|
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.
Summary
Adds the proto delta needed to pass an already-computed sales tax from the
presentation (Invoicer) layer down into the Contract data service, and keeps the
customer's tax registration number on
BillingDetailswhere it is read.Changes
CreateContractRequest.sales_tax(InvoiceLineItem, tag7) andRolloverContractRequest.sales_tax(InvoiceLineItem, tag6): thepre-computed sales tax (amount in cents + a human-readable label) for the
invoice. Contract folds it into the invoice amount before charge-forgiveness
is applied, kept separate from the priced
line_items. It is a message field,so presence is checked via
HasField; unset means no sales tax applies.BillingDetails.tax_number(string, tag6): the customer's taxregistration number (e.g. VAT ID) on file, used upstream when determining the
customer's tax treatment.
Why
Sales tax is now computed in the Invoicer (presentation) layer, before the
Contract request is built. The computed result is passed down via
sales_tax,so Contract no longer computes tax and no longer needs a tax-id input of its own.
Relationship to #284
This supersedes the design in #284, which added
customer_tax_idto the twocontract requests so Contract could compute tax itself. Those request fields are
dropped here — Contract no longer computes tax.
tax_numberstill lands onBillingDetails(it was also in #284) because the Invoicer reads it to computetax. #284 is left open for reference; it is not being merged.
Generated bindings
contract.v1andbilling_details.v1.VERSION/CHANGELOG/Cargo.lockversion bumps are left to releaseautomation.
Verification
buf lint,buf format, andbuf breaking(againstmain) all pass — thefields are purely additive.
cargo checkandcargo clippy -- -D warningspass for thesentry_protoscrate.
HasField("sales_tax")/HasField("tax_number")behave correctly on the generated Python messages.
Refs REVENG-15