1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-16 16:23:44 +00:00

[AC-1418] Add missing SM plan properties

This commit is contained in:
Shane Melton
2023-06-21 15:11:08 -07:00
parent 945289bf05
commit 202cf8614e
2 changed files with 36 additions and 0 deletions

View File

@@ -13,6 +13,7 @@ export class OrganizationResponse extends BaseResponse {
businessTaxNumber: string; businessTaxNumber: string;
billingEmail: string; billingEmail: string;
plan: PlanResponse; plan: PlanResponse;
secretsManagerPlan: PlanResponse;
planType: PlanType; planType: PlanType;
seats: number; seats: number;
maxAutoscaleSeats: number; maxAutoscaleSeats: number;
@@ -27,6 +28,11 @@ export class OrganizationResponse extends BaseResponse {
useResetPassword: boolean; useResetPassword: boolean;
useSecretsManager: boolean; useSecretsManager: boolean;
hasPublicAndPrivateKeys: boolean; hasPublicAndPrivateKeys: boolean;
usePasswordManager: boolean;
smSeats?: number;
smServiceAccounts?: number;
maxAutoscaleSmSeats?: number;
maxAutoscaleSmServiceAccounts?: number;
constructor(response: any) { constructor(response: any) {
super(response); super(response);
@@ -39,8 +45,14 @@ export class OrganizationResponse extends BaseResponse {
this.businessCountry = this.getResponseProperty("BusinessCountry"); this.businessCountry = this.getResponseProperty("BusinessCountry");
this.businessTaxNumber = this.getResponseProperty("BusinessTaxNumber"); this.businessTaxNumber = this.getResponseProperty("BusinessTaxNumber");
this.billingEmail = this.getResponseProperty("BillingEmail"); this.billingEmail = this.getResponseProperty("BillingEmail");
const plan = this.getResponseProperty("Plan"); const plan = this.getResponseProperty("Plan");
this.plan = plan == null ? null : new PlanResponse(plan); this.plan = plan == null ? null : new PlanResponse(plan);
const secretsManagerPlan = this.getResponseProperty("SecretsManagerPlan");
this.secretsManagerPlan =
secretsManagerPlan == null ? null : new PlanResponse(secretsManagerPlan);
this.planType = this.getResponseProperty("PlanType"); this.planType = this.getResponseProperty("PlanType");
this.seats = this.getResponseProperty("Seats"); this.seats = this.getResponseProperty("Seats");
this.maxAutoscaleSeats = this.getResponseProperty("MaxAutoscaleSeats"); this.maxAutoscaleSeats = this.getResponseProperty("MaxAutoscaleSeats");
@@ -55,5 +67,10 @@ export class OrganizationResponse extends BaseResponse {
this.useResetPassword = this.getResponseProperty("UseResetPassword"); this.useResetPassword = this.getResponseProperty("UseResetPassword");
this.useSecretsManager = this.getResponseProperty("UseSecretsManager"); this.useSecretsManager = this.getResponseProperty("UseSecretsManager");
this.hasPublicAndPrivateKeys = this.getResponseProperty("HasPublicAndPrivateKeys"); this.hasPublicAndPrivateKeys = this.getResponseProperty("HasPublicAndPrivateKeys");
this.usePasswordManager = this.getResponseProperty("UsePasswordManager");
this.smSeats = this.getResponseProperty("SmSeats");
this.smServiceAccounts = this.getResponseProperty("SmServiceAccounts");
this.maxAutoscaleSmSeats = this.getResponseProperty("MaxAutoscaleSmSeats");
this.maxAutoscaleSmServiceAccounts = this.getResponseProperty("MaxAutoscaleSmServiceAccounts");
} }
} }

View File

@@ -1,12 +1,14 @@
import { ProductType } from "../../../enums"; import { ProductType } from "../../../enums";
import { BaseResponse } from "../../../models/response/base.response"; import { BaseResponse } from "../../../models/response/base.response";
import { PlanType } from "../../enums"; import { PlanType } from "../../enums";
import { BitwardenProductType } from "../../enums/bitwarden-product-type.enum";
export class PlanResponse extends BaseResponse { export class PlanResponse extends BaseResponse {
type: PlanType; type: PlanType;
product: ProductType; product: ProductType;
name: string; name: string;
isAnnual: boolean; isAnnual: boolean;
bitwardenProduct: BitwardenProductType;
nameLocalizationKey: string; nameLocalizationKey: string;
descriptionLocalizationKey: string; descriptionLocalizationKey: string;
canBeUsedByBusiness: boolean; canBeUsedByBusiness: boolean;
@@ -48,6 +50,13 @@ export class PlanResponse extends BaseResponse {
additionalStoragePricePerGb: number; additionalStoragePricePerGb: number;
premiumAccessOptionPrice: number; premiumAccessOptionPrice: number;
// SM only
additionalPricePerServiceAccount: number;
baseServiceAccount: number;
maxServiceAccount: number;
hasAdditionalServiceAccountOption: boolean;
maxProjects: number;
constructor(response: any) { constructor(response: any) {
super(response); super(response);
this.type = this.getResponseProperty("Type"); this.type = this.getResponseProperty("Type");
@@ -90,5 +99,15 @@ export class PlanResponse extends BaseResponse {
this.seatPrice = this.getResponseProperty("SeatPrice"); this.seatPrice = this.getResponseProperty("SeatPrice");
this.additionalStoragePricePerGb = this.getResponseProperty("AdditionalStoragePricePerGb"); this.additionalStoragePricePerGb = this.getResponseProperty("AdditionalStoragePricePerGb");
this.premiumAccessOptionPrice = this.getResponseProperty("PremiumAccessOptionPrice"); this.premiumAccessOptionPrice = this.getResponseProperty("PremiumAccessOptionPrice");
this.bitwardenProduct = this.getResponseProperty("BitwardenProduct");
this.additionalPricePerServiceAccount = this.getResponseProperty(
"AdditionalPricePerServiceAccount"
);
this.baseServiceAccount = this.getResponseProperty("BaseServiceAccount");
this.maxServiceAccount = this.getResponseProperty("MaxServiceAccount");
this.hasAdditionalServiceAccountOption = this.getResponseProperty(
"HasAdditionalServiceAccountOption"
);
this.maxProjects = this.getResponseProperty("MaxProjects");
} }
} }