From 2de2a8ef681dd33a93a2a08f8d3d0f5289286fbf Mon Sep 17 00:00:00 2001 From: Alberto Leal Date: Thu, 11 Jun 2026 17:08:03 -0400 Subject: [PATCH 1/2] feat(billing): add tax_number to contract requests and Invoice The invoicer already resolves the customer's tax number for tax calculation but the contract service has no way to receive or expose it, so it is never persisted on the invoice. Carry it on CreateContractRequest and RolloverContractRequest so the invoice snapshot includes the tax number used at invoicing time, and expose it on Invoice so receipts render the persisted value instead of re-deriving from current billing details. Regenerates the Rust bindings. --- .../contract/v1/endpoint_create_contract.proto | 4 ++++ .../contract/v1/endpoint_rollover_contract.proto | 4 ++++ .../billing/v1/services/contract/v1/invoice.proto | 3 +++ ...entry_protos.billing.v1.services.contract.v1.rs | 14 ++++++++++++++ 4 files changed, 25 insertions(+) diff --git a/proto/sentry_protos/billing/v1/services/contract/v1/endpoint_create_contract.proto b/proto/sentry_protos/billing/v1/services/contract/v1/endpoint_create_contract.proto index 0bc0d05b..964242bc 100644 --- a/proto/sentry_protos/billing/v1/services/contract/v1/endpoint_create_contract.proto +++ b/proto/sentry_protos/billing/v1/services/contract/v1/endpoint_create_contract.proto @@ -16,6 +16,10 @@ message CreateContractRequest { // supported_month_intervals. If unset, defaults to the package's first // supported interval. uint32 month_interval = 6; + // The customer's tax registration number at invoicing time, persisted on the + // created invoice for receipts and reverse-charge determination. Unset if none + // is on file. + optional string tax_number = 7; } message CreateContractResponse { diff --git a/proto/sentry_protos/billing/v1/services/contract/v1/endpoint_rollover_contract.proto b/proto/sentry_protos/billing/v1/services/contract/v1/endpoint_rollover_contract.proto index fc4cdfd9..9e519e34 100644 --- a/proto/sentry_protos/billing/v1/services/contract/v1/endpoint_rollover_contract.proto +++ b/proto/sentry_protos/billing/v1/services/contract/v1/endpoint_rollover_contract.proto @@ -18,6 +18,10 @@ message RolloverContractRequest { // The pending change to apply to the new contract, if any. Unset means no // pending change is being applied during this rollover. optional sentry_protos.billing.v1.common.v1.PendingChange pending_change = 5; + // The customer's tax registration number at invoicing time, persisted on the + // created invoice for receipts and reverse-charge determination. Unset if none + // is on file. + optional string tax_number = 6; } message RolloverContractResponse { diff --git a/proto/sentry_protos/billing/v1/services/contract/v1/invoice.proto b/proto/sentry_protos/billing/v1/services/contract/v1/invoice.proto index 57757916..37b74eb5 100644 --- a/proto/sentry_protos/billing/v1/services/contract/v1/invoice.proto +++ b/proto/sentry_protos/billing/v1/services/contract/v1/invoice.proto @@ -29,4 +29,7 @@ message Invoice { string guid = 7; bool needs_charged = 8; sentry_protos.billing.v1.common.v1.Address address = 9; + // The customer's tax registration number as persisted at invoicing time. + // Unset if none was on file. + optional string tax_number = 10; } diff --git a/rust/src/sentry_protos.billing.v1.services.contract.v1.rs b/rust/src/sentry_protos.billing.v1.services.contract.v1.rs index 7742bb35..f065b7c3 100644 --- a/rust/src/sentry_protos.billing.v1.services.contract.v1.rs +++ b/rust/src/sentry_protos.billing.v1.services.contract.v1.rs @@ -401,6 +401,10 @@ pub struct Invoice { pub needs_charged: bool, #[prost(message, optional, tag = "9")] pub address: ::core::option::Option, + /// The customer's tax registration number as persisted at invoicing time. + /// Unset if none was on file. + #[prost(string, optional, tag = "10")] + pub tax_number: ::core::option::Option<::prost::alloc::string::String>, } #[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct OptionValue { @@ -499,6 +503,11 @@ pub struct CreateContractRequest { /// supported interval. #[prost(uint32, tag = "6")] pub month_interval: u32, + /// The customer's tax registration number at invoicing time, persisted on the + /// created invoice for receipts and reverse-charge determination. Unset if none + /// is on file. + #[prost(string, optional, tag = "7")] + pub tax_number: ::core::option::Option<::prost::alloc::string::String>, } #[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct CreateContractResponse { @@ -691,6 +700,11 @@ pub struct RolloverContractRequest { pub pending_change: ::core::option::Option< super::super::super::common::v1::PendingChange, >, + /// The customer's tax registration number at invoicing time, persisted on the + /// created invoice for receipts and reverse-charge determination. Unset if none + /// is on file. + #[prost(string, optional, tag = "6")] + pub tax_number: ::core::option::Option<::prost::alloc::string::String>, } #[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)] pub struct RolloverContractResponse { From 6225a961d43b3ec86c7d33091d612c270f1d671c Mon Sep 17 00:00:00 2001 From: "getsantry[bot]" <66042841+getsantry[bot]@users.noreply.github.com> Date: Thu, 11 Jun 2026 21:09:12 +0000 Subject: [PATCH 2/2] chore: Regenerate Rust bindings --- Cargo.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Cargo.lock b/Cargo.lock index 5847e137..8eaa8294 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -717,7 +717,7 @@ checksum = "955d28af4278de8121b7ebeb796b6a45735dc01436d898801014aced2773a3d6" [[package]] name = "sentry_protos" -version = "0.27.0" +version = "0.27.1" dependencies = [ "prost", "prost-types",