chore(billing-platform): Add protos for the tax-transaction settlement endpoints#317
Draft
dashed wants to merge 1 commit into
Draft
chore(billing-platform): Add protos for the tax-transaction settlement endpoints#317dashed wants to merge 1 commit into
dashed wants to merge 1 commit into
Conversation
…t endpoints Adds the contract-service messages backing getsentry PR #20632 (tax-transaction settlement), where the platform commits an invoice's provider-side tax document once the invoice is paid and voids it once the dunning schedule is exhausted. New messages, one endpoint_*.proto per request/response pair, mirroring MarkInvoicePaid: - GetTaxTransaction — reads the invoice's tax-document linkage (external reference, status, needs_retry) so settlement can decide commit vs void. - MarkTaxTransactionCommitted / MarkTaxTransactionVoided — record the settled status, carrying needs_retry so the reconciliation sweep can re-drive a vendor call that did not confirm. Plus a standalone TaxTransactionStatus enum (PENDING=1, COMMITTED=2, VOID=3, with the proto3 UNSPECIFIED=0 zero value) matching the persisted statuses. These back ContractService methods currently prototyped with proto-free dataclasses; the dataclasses are intentionally left in place, and migrating them to these messages is a later step. SetPendingTaxTransaction is already covered by #315. Only the .proto sources are authored; the rust stubs are regenerated and python stubs build at package time.
|
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.
Adds the contract-service messages backing https://github.com/getsentry/getsentry/pull/20632 (tax-transaction settlement). That slice settles an invoice's provider-side tax document once the charge outcome is known: it commits the document (finalizes it into the vendor's filings) when the invoice is paid, and voids it when the dunning schedule is exhausted and the invoice is abandoned.
Three endpoints, one
endpoint_*.protoper request/response pair (mirroringMarkInvoicePaid):GetTaxTransaction— reads the tax-document linkage recorded on an invoice (external_reference,status,needs_retry) so settlement can decide whether to commit or void.external_referenceandstatusareoptionalbecause a shadow or untaxed invoice carries no document;needs_retryis a barebool(a null DB value reads asfalse).MarkTaxTransactionCommitted/MarkTaxTransactionVoided— record the settled status. Each carriesneeds_retryso the reconciliation sweep can re-drive a vendor call that did not confirm, and returnsupdated(true if a matching invoice was found).Plus a standalone
TaxTransactionStatusenum (PENDING = 1,COMMITTED = 2,VOID = 3, with the proto3UNSPECIFIED = 0zero value), kept in its own file alongside the existing standalone type files (e.g.sku.proto) since the endpoint files are message-only.These back
ContractServicemethods that are currently prototyped with proto-free dataclasses (the dataclass-prototype pattern). The dataclasses are intentionally left in place here — migrating them onto these messages is a later step.SetPendingTaxTransaction(the pending-link slice) is already covered by #315.Only the
.protosources are authored; the rust stubs are regenerated at build time and the python stubs build at package time.