From dc0790d488170511bc12141c6f1cb05d5237e703 Mon Sep 17 00:00:00 2001 From: RoxyFarhad Date: Wed, 9 Oct 2024 15:50:22 +0100 Subject: [PATCH] make it more extensible --- proto/viam/app/v1/billing.proto | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/proto/viam/app/v1/billing.proto b/proto/viam/app/v1/billing.proto index 067abadd..83368544 100644 --- a/proto/viam/app/v1/billing.proto +++ b/proto/viam/app/v1/billing.proto @@ -74,11 +74,23 @@ enum UsageCostType { USAGE_COST_TYPE_PER_MACHINE = 8; } +enum SourceType { + SOURCE_TYPE_UNSPECIFIED = 0; + SOURCE_TYPE_ORG = 1; + SOURCE_TYPE_FRAGMENT = 2; +} + message UsageCost { UsageCostType resource_type = 1; double cost = 2; } +message ResourceUsageCostsBySource { + SourceType source_type = 1; + ResourceUsageCosts resource_usage_costs = 2; + string tier_name = 3; +} + message ResourceUsageCosts { repeated UsageCost usage_costs = 1; double discount = 2; @@ -94,10 +106,8 @@ message FragmentUsageCosts { message GetCurrentMonthUsageResponse { google.protobuf.Timestamp start_date = 1; google.protobuf.Timestamp end_date = 2; - - ResourceUsageCosts org_usage = 14; - repeated FragmentUsageCosts fragment_usage_costs = 15; - double subtotal = 16; + repeated ResourceUsageCostsBySource resource_usage_costs_by_source = 3; + double subtotal = 4; } message GetOrgBillingInformationRequest {