mirror of
https://github.com/bitwarden/browser
synced 2026-01-27 14:53:44 +00:00
feat(billing): Add upgrade endpoint
This commit is contained in:
@@ -1,7 +1,9 @@
|
||||
import { Injectable } from "@angular/core";
|
||||
|
||||
import { ApiService } from "@bitwarden/common/abstractions/api.service";
|
||||
import { ProductTierType } from "@bitwarden/common/billing/enums";
|
||||
import { BitwardenSubscriptionResponse } from "@bitwarden/common/billing/models/response/bitwarden-subscription.response";
|
||||
import { SubscriptionCadence } from "@bitwarden/common/billing/types/subscription-pricing-tier";
|
||||
import { BitwardenSubscription } from "@bitwarden/subscription";
|
||||
|
||||
import {
|
||||
@@ -53,4 +55,20 @@ export class AccountBillingClient {
|
||||
const path = `${this.endpoint}/subscription/storage`;
|
||||
await this.apiService.send("PUT", path, { additionalStorageGb }, true, false);
|
||||
};
|
||||
|
||||
upgradePremiumToOrganization = async (
|
||||
organizationName: string,
|
||||
organizationKey: string,
|
||||
planTier: ProductTierType,
|
||||
cadence: SubscriptionCadence,
|
||||
): Promise<void> => {
|
||||
const path = `${this.endpoint}/upgrade`;
|
||||
await this.apiService.send(
|
||||
"POST",
|
||||
path,
|
||||
{ organizationName, key: organizationKey, tier: planTier, cadence },
|
||||
true,
|
||||
false,
|
||||
);
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user