From 80aeb39287c488aba3fa17b6b4d6450b97527588 Mon Sep 17 00:00:00 2001 From: Kush Sharma Date: Tue, 13 Feb 2024 10:56:13 +0530 Subject: [PATCH] feat(frontier): allow listing all features - allow listing all invoices - additional subscription details Signed-off-by: Kush Sharma --- raystack/frontier/v1beta1/admin.proto | 17 +++++++++++++++++ raystack/frontier/v1beta1/frontier.proto | 16 ++++++++++++++++ raystack/frontier/v1beta1/models.proto | 5 +++++ 3 files changed, 38 insertions(+) diff --git a/raystack/frontier/v1beta1/admin.proto b/raystack/frontier/v1beta1/admin.proto index 7d36c061..dd99c6e5 100644 --- a/raystack/frontier/v1beta1/admin.proto +++ b/raystack/frontier/v1beta1/admin.proto @@ -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 { @@ -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; } \ No newline at end of file diff --git a/raystack/frontier/v1beta1/frontier.proto b/raystack/frontier/v1beta1/frontier.proto index c3ecaa57..5fb84591 100644 --- a/raystack/frontier/v1beta1/frontier.proto +++ b/raystack/frontier/v1beta1/frontier.proto @@ -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) = { @@ -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; diff --git a/raystack/frontier/v1beta1/models.proto b/raystack/frontier/v1beta1/models.proto index 2a8c44c6..f3e42a39 100644 --- a/raystack/frontier/v1beta1/models.proto +++ b/raystack/frontier/v1beta1/models.proto @@ -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; @@ -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;