Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
68 changes: 39 additions & 29 deletions rust/src/sentry_protos.billing.v1.services.contract.v1.rs
Original file line number Diff line number Diff line change
Expand Up @@ -435,6 +435,34 @@ pub struct Contract {
#[prost(message, optional, tag = "3")]
pub pricing_config: ::core::option::Option<PricingConfig>,
}
/// 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<InvoiceLineItem>,
/// 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")]
Expand All @@ -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<UserConfig>,
#[prost(message, repeated, tag = "4")]
pub line_items: ::prost::alloc::vec::Vec<InvoiceLineItem>,
}
#[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 {
Expand All @@ -467,34 +505,6 @@ pub struct GetContractResponse {
#[prost(message, optional, tag = "1")]
pub contract: ::core::option::Option<Contract>,
}
/// 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<InvoiceLineItem>,
/// 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")]
Expand Down
Loading