mirror of
https://github.com/bitwarden/browser
synced 2025-12-16 16:23:44 +00:00
[AC-1486] Feature: SM Billing Round 1 (#5747)
* [AC-1423] Update organization subscription cloud page (#5614) * [AC-1423] Add ProgressModule to shared.module.ts * [AC-1423] Update cloud subscription page styles - Remove bootstrap styles - Use CL components where applicable - Use CL typography directives - Update heading levels to prepare for new SM sections * [AC-1423] Add usePasswordManager boolean to organization domain * [AC-1423] Introduce BitwardenProductType enum * [AC-1423] Update Organization subscription line items - Add product type prefix - Indent addon services like additional storage and service accounts - Show line items for free plans * [AC-1420] Add Secrets Manager subscribe component (#5617) * [AC-1418] Add secrets manager manage subscription component (#5661) * add additional properties (#5743) * Allow autoscale limits to be removed, update naming (#5781) * [AC-1488] Store Organization.SmServiceAccounts as total not additional (#5784) * Allow autoscale limits to be removed, update naming * Display additional service accounts only * [AC-1531] Fix SM subscribe component not showing in free org billing tab (#5848) --------- Co-authored-by: Shane Melton <smelton@bitwarden.com> Co-authored-by: Thomas Rittson <31796059+eliykat@users.noreply.github.com> Co-authored-by: Thomas Rittson <trittson@bitwarden.com> Co-authored-by: cyprain-okeke <108260115+cyprain-okeke@users.noreply.github.com> Co-authored-by: Rui Tome <rtome@bitwarden.com>
This commit is contained in:
@@ -0,0 +1,4 @@
|
||||
export enum BitwardenProductType {
|
||||
PasswordManager = 0,
|
||||
SecretsManager = 1,
|
||||
}
|
||||
@@ -2,3 +2,4 @@ export * from "./payment-method-type.enum";
|
||||
export * from "./plan-sponsorship-type.enum";
|
||||
export * from "./plan-type.enum";
|
||||
export * from "./transaction-type.enum";
|
||||
export * from "./bitwarden-product-type.enum";
|
||||
|
||||
@@ -0,0 +1,21 @@
|
||||
export class OrganizationSmSubscriptionUpdateRequest {
|
||||
/**
|
||||
* The number of seats to add or remove from the subscription.
|
||||
*/
|
||||
seatAdjustment: number;
|
||||
|
||||
/**
|
||||
* The maximum number of seats that can be auto-scaled for the subscription.
|
||||
*/
|
||||
maxAutoscaleSeats?: number;
|
||||
|
||||
/**
|
||||
* The number of additional service accounts to add or remove from the subscription.
|
||||
*/
|
||||
serviceAccountAdjustment: number;
|
||||
|
||||
/**
|
||||
* The maximum number of additional service accounts that can be auto-scaled for the subscription.
|
||||
*/
|
||||
maxAutoscaleServiceAccounts?: number;
|
||||
}
|
||||
@@ -1,3 +1,23 @@
|
||||
export class OrganizationSubscriptionUpdateRequest {
|
||||
constructor(public seatAdjustment: number, public maxAutoscaleSeats?: number) {}
|
||||
/**
|
||||
* The number of seats to add or remove from the subscription.
|
||||
* Applies to both PM and SM request types.
|
||||
*/
|
||||
seatAdjustment: number;
|
||||
|
||||
/**
|
||||
* The maximum number of seats that can be auto-scaled for the subscription.
|
||||
* Applies to both PM and SM request types.
|
||||
*/
|
||||
maxAutoscaleSeats?: number;
|
||||
|
||||
/**
|
||||
* Build a subscription update request for the Password Manager product type.
|
||||
* @param seatAdjustment - The number of seats to add or remove from the subscription.
|
||||
* @param maxAutoscaleSeats - The maximum number of seats that can be auto-scaled for the subscription.
|
||||
*/
|
||||
constructor(seatAdjustment: number, maxAutoscaleSeats?: number) {
|
||||
this.seatAdjustment = seatAdjustment;
|
||||
this.maxAutoscaleSeats = maxAutoscaleSeats;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,4 @@
|
||||
export class SecretsManagerSubscribeRequest {
|
||||
additionalSmSeats: number;
|
||||
additionalServiceAccounts: number;
|
||||
}
|
||||
@@ -1,10 +1,11 @@
|
||||
import { ProductType } from "../../../enums";
|
||||
import { BaseResponse } from "../../../models/response/base.response";
|
||||
import { PlanType } from "../../enums";
|
||||
import { BitwardenProductType, PlanType } from "../../enums";
|
||||
|
||||
export class PlanResponse extends BaseResponse {
|
||||
type: PlanType;
|
||||
product: ProductType;
|
||||
bitwardenProduct: BitwardenProductType;
|
||||
name: string;
|
||||
isAnnual: boolean;
|
||||
nameLocalizationKey: string;
|
||||
@@ -48,6 +49,15 @@ export class PlanResponse extends BaseResponse {
|
||||
additionalStoragePricePerGb: number;
|
||||
premiumAccessOptionPrice: number;
|
||||
|
||||
// SM only
|
||||
additionalPricePerServiceAccount: number;
|
||||
baseServiceAccount: number;
|
||||
maxServiceAccount: number;
|
||||
hasAdditionalServiceAccountOption: boolean;
|
||||
maxProjects: number;
|
||||
maxAdditionalServiceAccounts: number;
|
||||
stripeServiceAccountPlanId: string;
|
||||
|
||||
constructor(response: any) {
|
||||
super(response);
|
||||
this.type = this.getResponseProperty("Type");
|
||||
@@ -90,5 +100,18 @@ export class PlanResponse extends BaseResponse {
|
||||
this.seatPrice = this.getResponseProperty("SeatPrice");
|
||||
this.additionalStoragePricePerGb = this.getResponseProperty("AdditionalStoragePricePerGb");
|
||||
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");
|
||||
this.maxAdditionalServiceAccounts = this.getResponseProperty("MaxAdditionalServiceAccounts");
|
||||
this.stripeServiceAccountPlanId = this.getResponseProperty("StripeServiceAccountPlanId");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import { BaseResponse } from "../../../models/response/base.response";
|
||||
import { BitwardenProductType } from "../../enums";
|
||||
|
||||
export class SubscriptionResponse extends BaseResponse {
|
||||
storageName: string;
|
||||
@@ -62,6 +63,8 @@ export class BillingSubscriptionItemResponse extends BaseResponse {
|
||||
quantity: number;
|
||||
interval: string;
|
||||
sponsoredSubscriptionItem: boolean;
|
||||
addonSubscriptionItem: boolean;
|
||||
bitwardenProduct: BitwardenProductType;
|
||||
|
||||
constructor(response: any) {
|
||||
super(response);
|
||||
@@ -70,6 +73,8 @@ export class BillingSubscriptionItemResponse extends BaseResponse {
|
||||
this.quantity = this.getResponseProperty("Quantity");
|
||||
this.interval = this.getResponseProperty("Interval");
|
||||
this.sponsoredSubscriptionItem = this.getResponseProperty("SponsoredSubscriptionItem");
|
||||
this.addonSubscriptionItem = this.getResponseProperty("AddonSubscriptionItem");
|
||||
this.bitwardenProduct = this.getResponseProperty("BitwardenProduct");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user