Skip to content
Draft
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
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ message PlatformCharge {
// sum ``refunds[*].amount_cents`` if they need the aggregate, and
// ``len(refunds) > 0`` (or sum == amount) signals "refunded."
repeated PlatformRefund refunds = 10;
// Unix epoch seconds when the charge row was created locally.
int64 date_added_st = 11;
}

// Canonical projection of a stored platform refund. One row per recorded
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
syntax = "proto3";

package sentry_protos.billing.v1.services.charge.v1;

import "sentry_protos/billing/v1/services/charge/v1/charge.proto";

// Lists PlatformCharges for a batch of invoice ids, refunds pre-attached.
message ListChargesForInvoiceIdsRequest {
repeated uint64 invoice_ids = 1;
}

message ListChargesForInvoiceIdsResponse {
repeated PlatformCharge charges = 1;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
syntax = "proto3";

package sentry_protos.billing.v1.services.charge.v1;

import "sentry_protos/billing/v1/services/charge/v1/charge.proto";

// Lists PlatformCharges for an organization, refunds pre-attached.
message ListChargesForOrganizationRequest {
uint64 organization_id = 1;
}

message ListChargesForOrganizationResponse {
repeated PlatformCharge charges = 1;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
syntax = "proto3";

package sentry_protos.billing.v1.services.contract.v1;

// Batch-resolves PlatformInvoice ids to their guids. Missing ids are
// silently omitted from the response.
message GetInvoiceGuidsForIdsRequest {
repeated uint64 invoice_ids = 1;
}

message GetInvoiceGuidsForIdsResponse {
map<uint64, string> invoice_guids = 1;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
syntax = "proto3";

package sentry_protos.billing.v1.services.contract.v1;

// Atomically stamps manual_payment_started_at on an unpaid PlatformInvoice.
message StartManualPaymentRequest {
uint64 invoice_id = 1;
}

message StartManualPaymentResponse {
// False when no row matched paid=false (invoice paid, missing, or raced).
bool updated = 1;
}
25 changes: 25 additions & 0 deletions rust/src/sentry_protos.billing.v1.services.charge.v1.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,9 @@ pub struct PlatformCharge {
/// `len(refunds) > 0` (or sum == amount) signals "refunded."
#[prost(message, repeated, tag = "10")]
pub refunds: ::prost::alloc::vec::Vec<PlatformRefund>,
/// Unix epoch seconds when the charge row was created locally.
#[prost(int64, tag = "11")]
pub date_added_st: i64,
}
/// Canonical projection of a stored platform refund. One row per recorded
/// refund against a `PlatformCharge`.
Expand Down Expand Up @@ -168,6 +171,28 @@ pub struct ListChargesForInvoiceResponse {
#[prost(message, repeated, tag = "1")]
pub charges: ::prost::alloc::vec::Vec<Charge>,
}
/// Lists PlatformCharges for a batch of invoice ids, refunds pre-attached.
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct ListChargesForInvoiceIdsRequest {
#[prost(uint64, repeated, tag = "1")]
pub invoice_ids: ::prost::alloc::vec::Vec<u64>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListChargesForInvoiceIdsResponse {
#[prost(message, repeated, tag = "1")]
pub charges: ::prost::alloc::vec::Vec<PlatformCharge>,
}
/// Lists PlatformCharges for an organization, refunds pre-attached.
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct ListChargesForOrganizationRequest {
#[prost(uint64, tag = "1")]
pub organization_id: u64,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListChargesForOrganizationResponse {
#[prost(message, repeated, tag = "1")]
pub charges: ::prost::alloc::vec::Vec<PlatformCharge>,
}
/// Lists every recorded refund associated with the charges for a single
/// platform invoice. Callers in the presentation layer use this to render
/// invoice-level refund state without crossing the charge service boundary.
Expand Down
26 changes: 26 additions & 0 deletions rust/src/sentry_protos.billing.v1.services.contract.v1.rs
Original file line number Diff line number Diff line change
Expand Up @@ -472,6 +472,8 @@ pub struct ContractMetadata {
pub billing_features: ::core::option::Option<super::super::super::FeatureOptions>,
#[prost(string, tag = "9")]
pub package_uid: ::prost::alloc::string::String,
#[prost(uint64, optional, tag = "10")]
pub previous_id: ::core::option::Option<u64>,
#[deprecated]
#[prost(uint64, tag = "8")]
pub package_id: u64,
Expand Down Expand Up @@ -584,6 +586,18 @@ pub struct GetInvoiceResponse {
#[prost(message, optional, tag = "1")]
pub invoice: ::core::option::Option<Invoice>,
}
/// Batch-resolves PlatformInvoice ids to their guids. Missing ids are
/// silently omitted from the response.
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct GetInvoiceGuidsForIdsRequest {
#[prost(uint64, repeated, tag = "1")]
pub invoice_ids: ::prost::alloc::vec::Vec<u64>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetInvoiceGuidsForIdsResponse {
#[prost(map = "uint64, string", tag = "1")]
pub invoice_guids: ::std::collections::HashMap<u64, ::prost::alloc::string::String>,
}
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct GetUnchargedInvoicesRequest {
/// Returns Invoices whose current billing period ends before this time and
Expand Down Expand Up @@ -746,3 +760,15 @@ pub struct RolloverContractResponse {
#[prost(uint64, tag = "4")]
pub new_contract_id: u64,
}
/// Atomically stamps manual_payment_started_at on an unpaid PlatformInvoice.
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct StartManualPaymentRequest {
#[prost(uint64, tag = "1")]
pub invoice_id: u64,
}
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct StartManualPaymentResponse {
/// False when no row matched paid=false (invoice paid, missing, or raced).
#[prost(bool, tag = "1")]
pub updated: bool,
}