-
-
Notifications
You must be signed in to change notification settings - Fork 2
chore(billing-platform): Convert BalanceService dataclasses in protobufs #339
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
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.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| syntax = "proto3"; | ||
|
|
||
| package sentry_protos.billing.v1.services.engagement.v1; | ||
|
|
||
| message AssignBalanceContractRequest { | ||
| optional uint64 previous_contract_id = 1; | ||
| uint64 contract_id = 2; | ||
| } | ||
|
|
||
| message AssignBalanceContractResponse { | ||
| bool assigned = 1; | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| syntax = "proto3"; | ||
|
|
||
| package sentry_protos.billing.v1.services.engagement.v1; | ||
|
|
||
| message GetContractBalanceRequest { | ||
| uint64 contract_id = 1; | ||
| } | ||
|
|
||
| message GetContractBalanceResponse { | ||
| uint64 balance_cents = 1; | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| syntax = "proto3"; | ||
|
|
||
| package sentry_protos.billing.v1.services.engagement.v1; | ||
|
|
||
| message GetUnassignedBalancesRequest {} | ||
|
|
||
| message GetUnassignedBalancesResponse { | ||
| repeated uint64 previous_contract_ids = 1; | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| syntax = "proto3"; | ||
|
|
||
| package sentry_protos.billing.v1.services.engagement.v1; | ||
|
|
||
| message RolloverMonetaryGrantsRequest { | ||
| uint64 previous_contract_id = 1; | ||
| uint64 next_contract_id = 2; | ||
| } | ||
|
|
||
| message RolloverMonetaryGrantsResponse {} |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| syntax = "proto3"; | ||
|
|
||
| package sentry_protos.billing.v1.services.engagement.v1; | ||
|
|
||
| message StageRolloverBalanceRequest { | ||
| uint64 contract_id = 1; | ||
| // Amount used in the previous contract that will be subtracted when carrying over the balance. | ||
| uint64 amount_used_cents = 2; | ||
| } | ||
|
|
||
| message StageRolloverBalanceResponse {} |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| syntax = "proto3"; | ||
|
|
||
| package sentry_protos.billing.v1.services.engagement.v1; | ||
|
|
||
| message StageRolloverMonetaryGrantsRequest { | ||
| uint64 previous_contract_id = 1; | ||
| optional uint64 balance_cents_used = 2; | ||
| } | ||
|
|
||
| message StageRolloverMonetaryGrantsResponse {} |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| syntax = "proto3"; | ||
|
|
||
| package sentry_protos.billing.v1.services.engagement.v1; | ||
|
|
||
| message UpsertContractBalanceRequest { | ||
| uint64 contract_id = 1; | ||
| int64 amount_cents = 2; | ||
| // There may not be a previous contract if this is the first contract for the organization. | ||
| optional uint64 previous_contract_id = 3; | ||
| } | ||
|
|
||
| message UpsertContractBalanceResponse { | ||
| uint64 new_balance_cents = 1; | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Bug: The response field Suggested FixTo prevent silent data corruption from negative balances, change the response field Prompt for AI AgentAlso affects:
Did we get this right? 👍 / 👎 to inform future reviews. |
||
| } | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what does this actually do?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah you're right this is pretty bad. i have a PR to refactor in getsentry.
after that's merged, i'll come back and fix these protobuf messages