Browse Source

Update the plan response

Ac-1410/update_planresponsemodel_on_client
cyprain-okeke 2 years ago
parent
commit
9df4d60798
No known key found for this signature in database
GPG Key ID: 80D6C9FF3519745
  1. 4
      libs/common/src/billing/enums/bitwarden-product-type.enum.ts
  2. 21
      libs/common/src/billing/models/response/plan.response.ts

4
libs/common/src/billing/enums/bitwarden-product-type.enum.ts

@ -0,0 +1,4 @@ @@ -0,0 +1,4 @@
export enum BitwardenProductType {
PasswordManager = 0,
SecretsManager = 1,
}

21
libs/common/src/billing/models/response/plan.response.ts

@ -1,6 +1,7 @@ @@ -1,6 +1,7 @@
import { ProductType } from "../../../enums";
import { BaseResponse } from "../../../models/response/base.response";
import { PlanType } from "../../enums";
import { BitwardenProductType } from "../../enums/bitwarden-product-type.enum";
export class PlanResponse extends BaseResponse {
type: PlanType;
@ -47,6 +48,14 @@ export class PlanResponse extends BaseResponse { @@ -47,6 +48,14 @@ export class PlanResponse extends BaseResponse {
seatPrice: number;
additionalStoragePricePerGb: number;
premiumAccessOptionPrice: number;
additionalPricePerServiceAccount: number;
baseServiceAccount: number;
maxServiceAccounts: number;
maxAdditionalServiceAccounts: number;
hasAdditionalServiceAccountOption: boolean;
maxProjects: boolean;
stripeServiceAccountPlanId: string;
bitwardenProductType: BitwardenProductType;
constructor(response: any) {
super(response);
@ -90,5 +99,17 @@ export class PlanResponse extends BaseResponse { @@ -90,5 +99,17 @@ export class PlanResponse extends BaseResponse {
this.seatPrice = this.getResponseProperty("SeatPrice");
this.additionalStoragePricePerGb = this.getResponseProperty("AdditionalStoragePricePerGb");
this.premiumAccessOptionPrice = this.getResponseProperty("PremiumAccessOptionPrice");
this.additionalPricePerServiceAccount = this.getResponseProperty(
"AdditionalPricePerServiceAccount"
);
this.baseServiceAccount = this.getResponseProperty("BaseServiceAccount");
this.maxServiceAccounts = this.getResponseProperty("MaxServiceAccounts");
this.maxAdditionalServiceAccounts = this.getResponseProperty("MaxAdditionalServiceAccounts");
this.hasAdditionalServiceAccountOption = this.getResponseProperty(
"HasAdditionalServiceAccountOption"
);
this.maxProjects = this.getResponseProperty("MaxProjects");
this.stripeServiceAccountPlanId = this.getResponseProperty("StripeServiceAccountPlanId");
this.bitwardenProductType = this.getResponseProperty("BitwardenProduct");
}
}

Loading…
Cancel
Save