Skip to content

chore(billing-platform): carry tax_transaction_code on contract create/rollover requests#319

Open
dashed wants to merge 1 commit into
mainfrom
aleal/feat/contract-tax-transaction-code
Open

chore(billing-platform): carry tax_transaction_code on contract create/rollover requests#319
dashed wants to merge 1 commit into
mainfrom
aleal/feat/contract-tax-transaction-code

Conversation

@dashed

@dashed dashed commented Jun 18, 2026

Copy link
Copy Markdown
Member

This is for PR https://github.com/getsentry/getsentry/pull/20624

Adds an optional tax_transaction_code (field 7) to CreateContractRequest and RolloverContractRequest.

This backs getsentry's atomic tax-linkage: today the platform persists the invoice and then writes the tax document's reference in a separate best-effort call (set_pending_tax_transaction), which can fail and leave a charged invoice with no linked tax document — collected-but-unremitted tax with no automated recovery. Carrying the reference in the create/rollover request lets the contract service write it in the same insert as the invoice amount, removing that window (mirroring how legacy billing links the code atomically in its Invoice.objects.create).

Field 7 leaves rollover field 6 free for the independent tax_pending flag (PR #287). Message-only; the generated Rust stub is regenerated here, Python stubs build at package time. Supersedes #315 (the standalone set_pending endpoint protos), which getsentry's atomic linkage removes.

…e/rollover requests

Adds an optional `tax_transaction_code` (field 7) to CreateContractRequest and
RolloverContractRequest so the contract service can record the tax provider's
document reference on the invoice atomically with creation.

This backs getsentry's atomic tax-linkage: today the platform persists the
invoice and then writes the document reference in a separate best-effort call,
which can fail and leave a charged invoice with no linked tax document. Carrying
the reference in the create/rollover request lets the contract service write it
in the same insert as the amount, removing that window. Field 7 leaves rollover
field 6 free for the independent tax_pending flag.
@github-actions

Copy link
Copy Markdown

The latest Buf updates on your PR. Results from workflow ci / buf-checks (pull_request).

BuildFormatLintBreakingUpdated (UTC)
✅ passed✅ passed✅ passed✅ passedJun 18, 2026, 8:03 PM

@dashed dashed self-assigned this Jun 18, 2026
@dashed dashed marked this pull request as ready for review June 18, 2026 22:02
@dashed dashed requested a review from a team as a code owner June 18, 2026 22:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant