From 867320911c202c46e618cc904818a092b0a3c141 Mon Sep 17 00:00:00 2001 From: Damodar Lohani Date: Sun, 22 Dec 2024 13:14:06 +0545 Subject: [PATCH] update models --- src/lib/sdk/billing.ts | 24 ++++++++++++++++++------ src/lib/stores/organization.ts | 2 ++ 2 files changed, 20 insertions(+), 6 deletions(-) diff --git a/src/lib/sdk/billing.ts b/src/lib/sdk/billing.ts index bee94ffc3..01e2008a5 100644 --- a/src/lib/sdk/billing.ts +++ b/src/lib/sdk/billing.ts @@ -174,6 +174,10 @@ export type Aggregation = { * Usage logs for the billing period. */ resources: OrganizationUsage; + /** + * Aggregation billing plan + */ + plan: string; }; export type OrganizationUsage = { @@ -388,19 +392,27 @@ export class Billing { ); } - async getPlan(organizationId: string): Promise { + async getOrganizationPlan(organizationId: string): Promise { const path = `/organizations/${organizationId}/plan`; - const params = { - organizationId - }; const uri = new URL(this.client.config.endpoint + path); return await this.client.call( 'get', uri, { 'content-type': 'application/json' - }, - params + } + ); + } + + async getPlan(planId: string): Promise { + const path = `/console/plans/${planId}`; + const uri = new URL(this.client.config.endpoint + path); + return await this.client.call( + 'get', + uri, + { + 'content-type': 'application/json' + } ); } diff --git a/src/lib/stores/organization.ts b/src/lib/stores/organization.ts index 0e1912c5f..53420f4e5 100644 --- a/src/lib/stores/organization.ts +++ b/src/lib/stores/organization.ts @@ -29,6 +29,8 @@ export type Organization = Models.Team> & { amount: number; billingTaxId?: string; billingPlanDowngrade?: Tier; + billingAggregationId: string; + billingInvoiceId: string; }; export type OrganizationList = {