mirror of
https://github.com/bitwarden/browser
synced 2025-12-20 02:03:39 +00:00
[AC-1423] Switch to AddonProductType enum instead of boolean
This commit is contained in:
8
libs/common/src/billing/enums/addon-product-type.enum.ts
Normal file
8
libs/common/src/billing/enums/addon-product-type.enum.ts
Normal file
@@ -0,0 +1,8 @@
|
||||
/**
|
||||
* Used to identify the various types of "addon" products that can be added
|
||||
* to an existing product subscription.
|
||||
*/
|
||||
export enum AddonProductType {
|
||||
PasswordManager_Storage = 0,
|
||||
SecretsManager_ServiceAccounts = 1,
|
||||
}
|
||||
@@ -1,4 +1,5 @@
|
||||
import { BaseResponse } from "../../../models/response/base.response";
|
||||
import { AddonProductType } from "../../enums/addon-product-type.enum";
|
||||
import { BitwardenProductType } from "../../enums/bitwarden-product-type.enum";
|
||||
|
||||
export class SubscriptionResponse extends BaseResponse {
|
||||
@@ -63,7 +64,7 @@ export class BillingSubscriptionItemResponse extends BaseResponse {
|
||||
quantity: number;
|
||||
interval: string;
|
||||
sponsoredSubscriptionItem: boolean;
|
||||
addonSubscriptionItem: boolean;
|
||||
addonProduct?: AddonProductType;
|
||||
bitwardenProduct: BitwardenProductType;
|
||||
|
||||
constructor(response: any) {
|
||||
@@ -73,7 +74,7 @@ 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.addonProduct = this.getResponseProperty("AddonProduct");
|
||||
this.bitwardenProduct = this.getResponseProperty("BitwardenProduct");
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user