Skip to content

Commit

Permalink
feat(frontier): allow listing all features
Browse files Browse the repository at this point in the history
- allow listing all invoices
- additional subscription details

Signed-off-by: Kush Sharma <[email protected]>
  • Loading branch information
kushsharma committed Feb 13, 2024
1 parent 4edd109 commit 80aeb39
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 0 deletions.
17 changes: 17 additions & 0 deletions raystack/frontier/v1beta1/admin.proto
Original file line number Diff line number Diff line change
Expand Up @@ -318,6 +318,15 @@ service AdminService {
description: "Checkout a product to buy it one time or start a subscription plan on a billing account manually. It bypasses billing engine.";
};
}

rpc ListAllInvoices(ListAllInvoicesRequest) returns (ListAllInvoicesResponse) {
option (google.api.http) = {get: "/v1beta1/admin/billing/invoices"};
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {
tags: "Invoice";
summary: "List all invoices";
description: "Lists all the invoices from all the organizations in a Frontier instance. It can be filtered by organization.";
};
}
}

message ListAllUsersRequest {
Expand Down Expand Up @@ -543,4 +552,12 @@ message DelegatedCheckoutResponse {
Subscription subscription = 1;
// product if bought
Product product = 2;
}

message ListAllInvoicesRequest {
string org_id = 1;
}

message ListAllInvoicesResponse {
repeated Invoice invoices = 1;
}
16 changes: 16 additions & 0 deletions raystack/frontier/v1beta1/frontier.proto
Original file line number Diff line number Diff line change
Expand Up @@ -1528,6 +1528,15 @@ service FrontierService {
};
}

rpc ListFeatures(ListFeaturesRequest) returns (ListFeaturesResponse) {
option (google.api.http) = {get: "/v1beta1/billing/features"};
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {
tags: "Feature";
summary: "List features";
description: "List all features";
};
}

// Plans
rpc CreatePlan(CreatePlanRequest) returns (CreatePlanResponse) {
option (google.api.http) = {
Expand Down Expand Up @@ -1935,6 +1944,13 @@ message UpdateProductResponse {
Product product = 1;
}

message ListFeaturesRequest {
}

message ListFeaturesResponse {
repeated Feature features = 1;
}

message PlanRequestBody {
string name = 1;
string title = 2;
Expand Down
5 changes: 5 additions & 0 deletions raystack/frontier/v1beta1/models.proto
Original file line number Diff line number Diff line change
Expand Up @@ -600,6 +600,9 @@ message Subscription {
google.protobuf.Timestamp canceled_at = 13;
google.protobuf.Timestamp ended_at = 14;
google.protobuf.Timestamp trial_ends_at = 15;
google.protobuf.Timestamp current_period_start_at = 16;
google.protobuf.Timestamp current_period_end_at = 17;
google.protobuf.Timestamp billing_cycle_anchor_at = 18;

message Phase {
google.protobuf.Timestamp effective_at = 1;
Expand Down Expand Up @@ -738,6 +741,8 @@ message Invoice {
google.protobuf.Timestamp due_date = 8;
// The date when this invoice is in effect.
google.protobuf.Timestamp effective_at = 9;
google.protobuf.Timestamp period_start_at = 10;
google.protobuf.Timestamp period_end_at = 11;

google.protobuf.Struct metadata = 20;
google.protobuf.Timestamp created_at = 21;
Expand Down

0 comments on commit 80aeb39

Please sign in to comment.