-
-
Notifications
You must be signed in to change notification settings - Fork 2
ref: Add contract v2 deleting deprecated fields #415
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Draft
noahsmartin
wants to merge
2
commits into
main
Choose a base branch
from
contractV2
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
43 changes: 43 additions & 0 deletions
43
proto/sentry_protos/billing/v1/services/contract/v2/billing_config.proto
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,43 @@ | ||
| syntax = "proto3"; | ||
|
|
||
| package sentry_protos.billing.v1.services.contract.v2; | ||
|
|
||
| import "sentry_protos/billing/v1/common/v1/sponsored_type.proto"; | ||
| import "sentry_protos/billing/v1/services/contract/v1/billing_config.proto"; | ||
|
|
||
| // Configuration for a sponsored contract. The presence of this message on a | ||
| // BillingConfig indicates the contract is sponsored; its absence means it is | ||
| // not. | ||
| message SponsorshipConfig { | ||
| // Whether this sponsored Contract is eligible to start trials. | ||
| bool can_trial = 1; | ||
|
|
||
| // Whether this sponsored Contract can checkout. | ||
| bool can_checkout = 2; | ||
|
|
||
| sentry_protos.billing.v1.common.v1.SponsoredType sponsorship_type = 3; | ||
| } | ||
|
|
||
| message BillingConfig { | ||
| // The number-of-months interval the contract was signed under | ||
| // (1 = monthly, 12 = annual). Frozen for the life of the contract. | ||
| uint32 month_interval = 1; | ||
|
|
||
| // Whether the org is allowed to incur pay-as-you-go usage. | ||
| // Credit-card orgs always support payg; invoiced orgs that should | ||
| // support it are an explicit override. | ||
| bool supports_payg = 2; | ||
|
|
||
| // Whether this is a managed (sales-assisted) subscription rather than | ||
| // self-serve. | ||
| bool is_managed = 3; | ||
|
|
||
| // Whether the org has a soft cap: usage past reserved volume is allowed | ||
| // (and billed) instead of hard-stopping ingestion. | ||
| bool has_soft_cap = 4; | ||
|
|
||
| // Sponsorship configuration. Absent means the contract is not sponsored. | ||
| optional SponsorshipConfig sponsorship_config = 5; | ||
|
|
||
| sentry_protos.billing.v1.services.contract.v1.ChargeConfig charge_config = 6; | ||
| } |
15 changes: 15 additions & 0 deletions
15
proto/sentry_protos/billing/v1/services/contract/v2/contract.proto
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| syntax = "proto3"; | ||
|
|
||
| package sentry_protos.billing.v1.services.contract.v2; | ||
|
|
||
| import "sentry_protos/billing/v1/services/contract/v1/retention_config.proto"; | ||
| import "sentry_protos/billing/v1/services/contract/v2/billing_config.proto"; | ||
| import "sentry_protos/billing/v1/services/contract/v2/contract_metadata.proto"; | ||
| import "sentry_protos/billing/v1/services/contract/v2/pricing_config.proto"; | ||
|
|
||
| message Contract { | ||
| ContractMetadata metadata = 1; | ||
| BillingConfig billing_config = 2; | ||
| PricingConfig pricing_config = 3; | ||
| sentry_protos.billing.v1.services.contract.v1.RetentionConfig retention_config = 4; | ||
| } |
17 changes: 17 additions & 0 deletions
17
proto/sentry_protos/billing/v1/services/contract/v2/contract_metadata.proto
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| syntax = "proto3"; | ||
|
|
||
| package sentry_protos.billing.v1.services.contract.v2; | ||
|
|
||
| import "sentry_protos/billing/v1/services/contract/v1/contract_metadata.proto"; | ||
|
|
||
| message ContractMetadata { | ||
| uint64 id = 1; | ||
| uint64 organization_id = 2; | ||
| // The set of BillingRules that the BillingRulesEngine has to execute for this contract. | ||
| string ruleset_version = 3; | ||
| // Catch-all for overrides and information not covered above. | ||
| sentry_protos.billing.v1.services.contract.v1.MetadataOptions custom_options = 4; | ||
| string package_uid = 5; | ||
|
|
||
| optional uint64 previous_id = 6; | ||
| } | ||
53 changes: 53 additions & 0 deletions
53
proto/sentry_protos/billing/v1/services/contract/v2/endpoint_create_contract.proto
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,53 @@ | ||
| syntax = "proto3"; | ||
|
|
||
| package sentry_protos.billing.v1.services.contract.v2; | ||
|
|
||
| import "sentry_protos/billing/v1/common/v1/address.proto"; | ||
| import "sentry_protos/billing/v1/common/v1/sponsored_type.proto"; | ||
| import "sentry_protos/billing/v1/services/contract/v1/billing_config.proto"; | ||
| 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 sentry_protos.billing.v1.services.contract.v1.UserConfig user_configs = 3; | ||
| repeated sentry_protos.billing.v1.services.contract.v1.InvoiceLineItem line_items = 4; | ||
| sentry_protos.billing.v1.common.v1.Address address = 5; | ||
| // The customer's chosen cadence. Must be one of the package's | ||
| // supported_month_intervals. If unset, defaults to the package's first | ||
| // supported interval. | ||
| uint32 month_interval = 6; | ||
|
|
||
| // How the contract is billed. If unset (BILLING_TYPE_UNSPECIFIED), the | ||
| // contract defaults to credit-card. | ||
| sentry_protos.billing.v1.services.contract.v1.BillingType billing_type = 7; | ||
|
|
||
| // Whether usage past reserved volume is allowed (and billed) instead of | ||
| // hard-stopping ingestion. | ||
| bool has_soft_cap = 8; | ||
|
|
||
| // The tax provider's reference for the tax document opened for this invoice. | ||
| // When set, the contract service records it on the created invoice as a | ||
| // pending tax transaction atomically with invoice creation. Unset means no | ||
| // tax document was opened. | ||
| optional string tax_transaction_code = 9; | ||
|
|
||
| // The sponsored type of the contract. If unset, then this is a non-sponsored | ||
| // contract. | ||
| optional sentry_protos.billing.v1.common.v1.SponsoredType sponsorship_type = 10; | ||
|
|
||
| // The customer's tax registration number (e.g. VAT ID) on file. | ||
| optional string tax_number = 11; | ||
|
|
||
| // Whether the tax provider placed this invoice under reverse charge. | ||
| bool is_reverse_charge = 12; | ||
| } | ||
|
|
||
| message CreateContractResponse { | ||
| uint64 id = 1; | ||
| uint64 invoice_id = 2; | ||
| string invoice_guid = 3; | ||
| bool needs_charge = 4; | ||
| uint64 amount_billed = 5; | ||
| } |
13 changes: 13 additions & 0 deletions
13
..._protos/billing/v1/services/contract/v2/endpoint_get_all_contracts_for_organization.proto
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| syntax = "proto3"; | ||
|
|
||
| package sentry_protos.billing.v1.services.contract.v2; | ||
|
|
||
| import "sentry_protos/billing/v1/services/contract/v2/contract.proto"; | ||
|
|
||
| message GetAllContractsForOrganizationRequest { | ||
| uint64 organization_id = 1; | ||
| } | ||
|
|
||
| message GetAllContractsForOrganizationResponse { | ||
| repeated Contract contracts = 1; | ||
| } |
21 changes: 21 additions & 0 deletions
21
proto/sentry_protos/billing/v1/services/contract/v2/endpoint_get_contract.proto
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| syntax = "proto3"; | ||
|
|
||
| package sentry_protos.billing.v1.services.contract.v2; | ||
|
|
||
| import "sentry_protos/billing/v1/date.proto"; | ||
| import "sentry_protos/billing/v1/services/contract/v2/contract.proto"; | ||
|
|
||
| message GetContractRequest { | ||
| uint64 organization_id = 1; | ||
|
|
||
| // If provided, returns the Contract active on this date. Otherwise, returns the current Contract. | ||
| sentry_protos.billing.v1.Date date = 2; | ||
| } | ||
|
|
||
| message GetSpecificContractRequest { | ||
| uint64 contract_id = 1; | ||
| } | ||
|
|
||
| message GetContractResponse { | ||
| Contract contract = 1; | ||
| } |
25 changes: 25 additions & 0 deletions
25
proto/sentry_protos/billing/v1/services/contract/v2/endpoint_get_uninvoiced_contracts.proto
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,25 @@ | ||
| syntax = "proto3"; | ||
|
|
||
| package sentry_protos.billing.v1.services.contract.v2; | ||
|
|
||
| import "google/protobuf/timestamp.proto"; | ||
|
|
||
| message GetUninvoicedContractsRequest { | ||
| // Returns Contracts whose current billing period ends before this time and | ||
| // have not yet been invoiced for the current period. | ||
| google.protobuf.Timestamp current_ts = 1; | ||
|
|
||
| // Maximum number of contracts to return in the response. If more contracts | ||
| // match the request than this limit, the response will have truncated set | ||
| // to true. | ||
| uint32 max_items = 2; | ||
|
|
||
| optional uint32 offset = 3; | ||
| } | ||
|
|
||
| message GetUninvoicedContractsResponse { | ||
| // True if additional matching contracts existed beyond max_items and were | ||
| // not included in this response. | ||
| bool truncated = 1; | ||
| repeated uint64 contract_ids = 2; | ||
| } |
20 changes: 20 additions & 0 deletions
20
proto/sentry_protos/billing/v1/services/contract/v2/pricing_config.proto
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| syntax = "proto3"; | ||
|
|
||
| package sentry_protos.billing.v1.services.contract.v2; | ||
|
|
||
| import "google/protobuf/timestamp.proto"; | ||
| import "sentry_protos/billing/v1/services/contract/v1/billing_config.proto"; | ||
| import "sentry_protos/billing/v1/services/contract/v1/pricing_config.proto"; | ||
|
|
||
| message PricingConfig { | ||
| // Determines when to reset quotas and charge the subscription price. | ||
| sentry_protos.billing.v1.services.contract.v1.Date billing_period_start_date = 1; | ||
| sentry_protos.billing.v1.services.contract.v1.Date billing_period_end_date = 2; | ||
|
|
||
| //Determines when the on demand period for invoicing the organization starts and ends, even for annual plans we bill ondemand monthly | ||
| sentry_protos.billing.v1.services.contract.v1.Date ondemand_period_start_date = 3; | ||
| sentry_protos.billing.v1.services.contract.v1.Date ondemand_period_end_date = 4; | ||
| optional google.protobuf.Timestamp usage_watermark_ts = 5; | ||
|
|
||
| repeated sentry_protos.billing.v1.services.contract.v1.UserConfig user_config = 6; | ||
| } |
29 changes: 29 additions & 0 deletions
29
proto/sentry_protos/billing/v1/services/invoicer/v2/endpoint_bill_contract_change.proto
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,29 @@ | ||
| syntax = "proto3"; | ||
|
|
||
| package sentry_protos.billing.v1.services.invoicer.v2; | ||
|
|
||
| import "sentry_protos/billing/v1/common/v1/pending_change.proto"; | ||
|
|
||
| // Invoices an immediate mid-term contract change and rolls the contract over | ||
| // now. The caller supplies the change to apply (target package/interval and the | ||
| // caps taking effect now). The invoicer prices the prorated new-plan charge and | ||
| // the credit for unused time on the current plan itself, settles accrued | ||
| // pay-as-you-go usage at the current contract's rates, applies monetary grants | ||
| // and sales tax, closes the current contract immediately, and opens the new | ||
| // contract with the supplied change applied. | ||
| message BillContractChangeRequest { | ||
| uint64 contract_id = 1; | ||
| // The change applied to the new contract: the target package/interval and the | ||
| // PAYG caps taking effect now. Reuses the PendingChange shape the rollover | ||
| // consumes, but here it applies immediately rather than at a period boundary, | ||
| // so the caller does not stage it in the pending-change store. | ||
| sentry_protos.billing.v1.common.v1.PendingChange change = 2; | ||
|
|
||
| // Whether the requested change should result in a new billing period. | ||
| bool start_new_term = 3; | ||
| } | ||
|
|
||
| message BillContractChangeResponse { | ||
| // The invoice that settles the change (and closes the previous contract). | ||
| uint64 invoice_id = 1; | ||
| } |
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
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.