From d3722de66310ce64ea51828bfad92dbe049ab6b6 Mon Sep 17 00:00:00 2001 From: Noah Martin Date: Thu, 30 Apr 2026 07:50:54 -0700 Subject: [PATCH 1/2] ref: Add invoicing fields to create contract endpoint --- .../v1/services/contract/v1/endpoint_create_contract.proto | 6 ++++++ 1 file changed, 6 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 63d683c..08005ef 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 @@ -2,14 +2,20 @@ syntax = "proto3"; package sentry_protos.billing.v1.services.contract.v1; +import "sentry_protos/billing/v1/services/contract/v1/invoice.proto"; import "sentry_protos/billing/v1/services/contract/v1/pricing_config.proto"; message CreateContractRequest { uint64 organization_id = 1; string package_uid = 2; repeated UserConfig user_configs = 3; + repeated InvoiceLineItem line_items = 4; } message CreateContractResponse { uint64 id = 1; + uint64 invoice_id = 2; + string invoice_guid = 3; + bool needs_charge = 4; + uint64 amount_billed = 5; } From 23f8dc1ad813b62f3404f4d837171eb474317168 Mon Sep 17 00:00:00 2001 From: "getsantry[bot]" <66042841+getsantry[bot]@users.noreply.github.com> Date: Thu, 30 Apr 2026 16:10:57 +0000 Subject: [PATCH 2/2] chore: Regenerate Rust bindings --- ..._protos.billing.v1.services.contract.v1.rs | 68 +++++++++++-------- 1 file changed, 39 insertions(+), 29 deletions(-) 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 1d450d4..861e553 100644 --- a/rust/src/sentry_protos.billing.v1.services.contract.v1.rs +++ b/rust/src/sentry_protos.billing.v1.services.contract.v1.rs @@ -435,6 +435,34 @@ pub struct Contract { #[prost(message, optional, tag = "3")] pub pricing_config: ::core::option::Option, } +/// This is not the same as LineItemDetails, it includes +/// items not related to the package such as tax. +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] +pub struct InvoiceLineItem { + /// Intentionally not a uint (some line items could be discounts) + #[prost(int64, tag = "1")] + pub amount_cents: i64, + #[prost(string, optional, tag = "2")] + pub description: ::core::option::Option<::prost::alloc::string::String>, +} +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct Invoice { + #[prost(uint64, tag = "1")] + pub invoice_id: u64, + #[prost(message, repeated, tag = "2")] + pub line_items: ::prost::alloc::vec::Vec, + /// Not just a sum of line items since there may be credit applied + #[prost(uint64, tag = "3")] + pub amount_billed: u64, + #[prost(uint64, tag = "4")] + pub organization_id: u64, + #[prost(bool, tag = "5")] + pub paid: bool, + #[prost(message, optional, tag = "6")] + pub date_added: ::core::option::Option<::prost_types::Timestamp>, + #[prost(string, tag = "7")] + pub guid: ::prost::alloc::string::String, +} #[derive(Clone, PartialEq, ::prost::Message)] pub struct CreateContractRequest { #[prost(uint64, tag = "1")] @@ -443,11 +471,21 @@ pub struct CreateContractRequest { pub package_uid: ::prost::alloc::string::String, #[prost(message, repeated, tag = "3")] pub user_configs: ::prost::alloc::vec::Vec, + #[prost(message, repeated, tag = "4")] + pub line_items: ::prost::alloc::vec::Vec, } -#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)] +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct CreateContractResponse { #[prost(uint64, tag = "1")] pub id: u64, + #[prost(uint64, tag = "2")] + pub invoice_id: u64, + #[prost(string, tag = "3")] + pub invoice_guid: ::prost::alloc::string::String, + #[prost(bool, tag = "4")] + pub needs_charge: bool, + #[prost(uint64, tag = "5")] + pub amount_billed: u64, } #[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)] pub struct GetContractRequest { @@ -467,34 +505,6 @@ pub struct GetContractResponse { #[prost(message, optional, tag = "1")] pub contract: ::core::option::Option, } -/// This is not the same as LineItemDetails, it includes -/// items not related to the package such as tax. -#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] -pub struct InvoiceLineItem { - /// Intentionally not a uint (some line items could be discounts) - #[prost(int64, tag = "1")] - pub amount_cents: i64, - #[prost(string, optional, tag = "2")] - pub description: ::core::option::Option<::prost::alloc::string::String>, -} -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct Invoice { - #[prost(uint64, tag = "1")] - pub invoice_id: u64, - #[prost(message, repeated, tag = "2")] - pub line_items: ::prost::alloc::vec::Vec, - /// Not just a sum of line items since there may be credit applied - #[prost(uint64, tag = "3")] - pub amount_billed: u64, - #[prost(uint64, tag = "4")] - pub organization_id: u64, - #[prost(bool, tag = "5")] - pub paid: bool, - #[prost(message, optional, tag = "6")] - pub date_added: ::core::option::Option<::prost_types::Timestamp>, - #[prost(string, tag = "7")] - pub guid: ::prost::alloc::string::String, -} #[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct GetInvoiceRequest { #[prost(uint64, tag = "1")]