Skip to content

Commit

Permalink
feat(frontier): create billing account without billing provider (#360)
Browse files Browse the repository at this point in the history
Signed-off-by: Kush Sharma <[email protected]>
  • Loading branch information
kushsharma authored Jun 7, 2024
1 parent 1ea75f0 commit 861875e
Showing 1 changed file with 63 additions and 0 deletions.
63 changes: 63 additions & 0 deletions raystack/frontier/v1beta1/frontier.proto
Original file line number Diff line number Diff line change
Expand Up @@ -1442,6 +1442,18 @@ service FrontierService {
};
}

rpc RegisterBillingAccount(RegisterBillingAccountRequest) returns (RegisterBillingAccountResponse) {
option (google.api.http) = {
post: "/v1beta1/organizations/{org_id}/billing/{id}/register",
body: "*"
};
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {
tags: "Billing";
summary: "Register billing account to provider";
description: "Register a billing account to a provider if it's not already.";
};
}

rpc ListBillingAccounts(ListBillingAccountsRequest) returns (ListBillingAccountsResponse) {
option (google.api.http) = {get: "/v1beta1/organizations/{org_id}/billing"};
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {
Expand All @@ -1460,6 +1472,30 @@ service FrontierService {
};
}

rpc EnableBillingAccount(EnableBillingAccountRequest) returns (EnableBillingAccountResponse) {
option (google.api.http) = {
post: "/v1beta1/organizations/{org_id}/billing/{id}/enable",
body: "*"
};
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {
tags: "Billing";
summary: "Enable billing account";
description: "Enable a billing account by ID.";
};
}

rpc DisableBillingAccount(DisableBillingAccountRequest) returns (DisableBillingAccountResponse) {
option (google.api.http) = {
post: "/v1beta1/organizations/{org_id}/billing/{id}/disable",
body: "*"
};
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {
tags: "Billing";
summary: "Disable billing account";
description: "Disable a billing account by ID.";
};
}

rpc GetBillingBalance(GetBillingBalanceRequest) returns (GetBillingBalanceResponse) {
option (google.api.http) = {get: "/v1beta1/organizations/{org_id}/billing/{id}/balance"};
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {
Expand Down Expand Up @@ -1783,6 +1819,8 @@ message CreateBillingAccountRequest {
string org_id = 1 [(validate.rules).string.min_len = 1];
// Billing account to create.
BillingAccountRequestBody body = 2 [(validate.rules).message.required = true];
// Offline billing account don't get registered with billing provider
bool offline = 3;
}

message CreateBillingAccountResponse {
Expand Down Expand Up @@ -1824,6 +1862,15 @@ message UpdateBillingAccountResponse {
BillingAccount billing_account = 1;
}

message RegisterBillingAccountRequest {
// ID of the billing account to register
string id = 1 [(validate.rules).string.uuid = true];

string org_id = 2 [(validate.rules).string.min_len = 1];
}

message RegisterBillingAccountResponse {}

message ListBillingAccountsRequest {
// ID of the organization to list billing accounts for
string org_id = 1 [(validate.rules).string.min_len = 1];
Expand All @@ -1845,6 +1892,22 @@ message DeleteBillingAccountRequest {

message DeleteBillingAccountResponse {}

message EnableBillingAccountRequest {
// ID of the billing account to enable
string id = 1 [(validate.rules).string.uuid = true];
string org_id = 2 [(validate.rules).string.min_len = 1];
}

message EnableBillingAccountResponse {}

message DisableBillingAccountRequest {
// ID of the billing account to disable
string id = 1 [(validate.rules).string.uuid = true];
string org_id = 2 [(validate.rules).string.min_len = 1];
}

message DisableBillingAccountResponse {}

message GetBillingBalanceRequest {
// ID of the billing account to get the balance for
string id = 1 [(validate.rules).string.uuid = true];
Expand Down

0 comments on commit 861875e

Please sign in to comment.