Skip to content
Open
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
75 changes: 75 additions & 0 deletions raystack/frontier/v1beta1/admin.proto
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,15 @@ service AdminService {

rpc ListAllBillingAccounts(ListAllBillingAccountsRequest) returns (ListAllBillingAccountsResponse) {}

// Plans
rpc CreatePlan(CreatePlanRequest) returns (CreatePlanResponse) {}

rpc UpdatePlan(UpdatePlanRequest) returns (UpdatePlanResponse) {}

// ListAllPlans returns every plan, including disabled ones, unlike
// FrontierService.ListPlans which returns active plans only.
rpc ListAllPlans(ListAllPlansRequest) returns (ListAllPlansResponse) {}

// Usage
rpc RevertBillingUsage(RevertBillingUsageRequest) returns (RevertBillingUsageResponse) {}

Expand Down Expand Up @@ -429,6 +438,72 @@ message ListAllBillingAccountsResponse {
repeated BillingAccount billing_accounts = 1;
}

message ListAllPlansRequest {
// filter by plan state, e.g. "active" or "disabled". an empty value returns all plans
string state = 1 [(buf.validate.field).string = {
in: [
"",
"active",
"disabled"
]
}];
}

message ListAllPlansResponse {
repeated Plan plans = 1;
}

message PlanRequestBody {
string name = 1;
string title = 2;
string description = 3;

repeated Product products = 4;
// known intervals are "day", "week", "month", and "year"
string interval = 5 [(buf.validate.field).string = {
in: [
"day",
"week",
"month",
"year"
]
}];
int64 on_start_credits = 6 [(buf.validate.field).int64.gte = 0];
int64 trial_days = 7 [(buf.validate.field).int64.gte = 0];

string state = 8 [(buf.validate.field).string = {
in: [
"",
"active",
"disabled"
]
}];

google.protobuf.Struct metadata = 20;
}

message CreatePlanRequest {
// Plan to create
PlanRequestBody body = 1 [(buf.validate.field).required = true];
}

message CreatePlanResponse {
// Created plan
Plan plan = 1;
}

message UpdatePlanRequest {
// ID of the plan to update
string id = 1 [(buf.validate.field).string.min_len = 1];
// Plan to update
PlanRequestBody body = 2;
}

message UpdatePlanResponse {
// Updated plan
Plan plan = 1;
}

message RevertBillingUsageRequest {
string org_id = 1;
// DEPRECATED
Expand Down
49 changes: 0 additions & 49 deletions raystack/frontier/v1beta1/frontier.proto
Original file line number Diff line number Diff line change
Expand Up @@ -339,14 +339,10 @@ service FrontierService {
rpc ListFeatures(ListFeaturesRequest) returns (ListFeaturesResponse) {}

// Plans
rpc CreatePlan(CreatePlanRequest) returns (CreatePlanResponse) {}

rpc ListPlans(ListPlansRequest) returns (ListPlansResponse) {}

rpc GetPlan(GetPlanRequest) returns (GetPlanResponse) {}

rpc UpdatePlan(UpdatePlanRequest) returns (UpdatePlanResponse) {}

// Checkout
rpc CreateCheckout(CreateCheckoutRequest) returns (CreateCheckoutResponse) {}

Expand Down Expand Up @@ -864,39 +860,6 @@ message ListFeaturesResponse {
repeated Feature features = 1;
}

message PlanRequestBody {
string name = 1;
string title = 2;
string description = 3;

repeated Product products = 4;
// known intervals are "day", "week", "month", and "year"
string interval = 5 [(buf.validate.field).string = {
in: [
"day",
"week",
"month",
"year"
]
}];
int64 on_start_credits = 6;
int64 trial_days = 7;

string state = 8;

google.protobuf.Struct metadata = 20;
}

message CreatePlanRequest {
// Plan to create
PlanRequestBody body = 1 [(buf.validate.field).required = true];
}

message CreatePlanResponse {
// Created plan
Plan plan = 1;
}

message GetPlanRequest {
// ID of the plan to get
string id = 1 [(buf.validate.field).string.min_len = 1];
Expand All @@ -907,18 +870,6 @@ message GetPlanResponse {
Plan plan = 1;
}

message UpdatePlanRequest {
// ID of the plan to update
string id = 1 [(buf.validate.field).string.min_len = 1];
// Plan to update
PlanRequestBody body = 2;
}

message UpdatePlanResponse {
// Updated plan
Plan plan = 1;
}

message ListInvoicesRequest {
string org_id = 1 [(buf.validate.field).string.min_len = 3];
reserved 2;
Expand Down
Loading