mirror of
https://github.com/bitwarden/browser
synced 2025-12-15 15:53:27 +00:00
Combined subscription and payment method pages in provider portal (#9828)
This commit is contained in:
@@ -1,29 +1,38 @@
|
||||
import { SubscriptionSuspensionResponse } from "@bitwarden/common/billing/models/response/subscription-suspension.response";
|
||||
import { TaxInfoResponse } from "@bitwarden/common/billing/models/response/tax-info.response";
|
||||
|
||||
import { BaseResponse } from "../../../models/response/base.response";
|
||||
|
||||
export class ProviderSubscriptionResponse extends BaseResponse {
|
||||
status: string;
|
||||
currentPeriodEndDate: Date;
|
||||
currentPeriodEndDate: string;
|
||||
discountPercentage?: number | null;
|
||||
plans: ProviderPlanResponse[] = [];
|
||||
collectionMethod: string;
|
||||
unpaidPeriodEndDate?: string;
|
||||
gracePeriod?: number | null;
|
||||
suspensionDate?: string;
|
||||
plans: ProviderPlanResponse[] = [];
|
||||
accountCredit: number;
|
||||
taxInformation?: TaxInfoResponse;
|
||||
cancelAt?: string;
|
||||
suspension?: SubscriptionSuspensionResponse;
|
||||
|
||||
constructor(response: any) {
|
||||
super(response);
|
||||
this.status = this.getResponseProperty("status");
|
||||
this.currentPeriodEndDate = new Date(this.getResponseProperty("currentPeriodEndDate"));
|
||||
this.currentPeriodEndDate = this.getResponseProperty("currentPeriodEndDate");
|
||||
this.discountPercentage = this.getResponseProperty("discountPercentage");
|
||||
this.collectionMethod = this.getResponseProperty("collectionMethod");
|
||||
this.unpaidPeriodEndDate = this.getResponseProperty("unpaidPeriodEndDate");
|
||||
this.gracePeriod = this.getResponseProperty("gracePeriod");
|
||||
this.suspensionDate = this.getResponseProperty("suspensionDate");
|
||||
this.cancelAt = this.getResponseProperty("cancelAt");
|
||||
const plans = this.getResponseProperty("plans");
|
||||
if (plans != null) {
|
||||
this.plans = plans.map((i: any) => new ProviderPlanResponse(i));
|
||||
this.plans = plans.map((plan: any) => new ProviderPlanResponse(plan));
|
||||
}
|
||||
this.accountCredit = this.getResponseProperty("accountCredit");
|
||||
const taxInformation = this.getResponseProperty("taxInformation");
|
||||
if (taxInformation != null) {
|
||||
this.taxInformation = new TaxInfoResponse(taxInformation);
|
||||
}
|
||||
this.cancelAt = this.getResponseProperty("cancelAt");
|
||||
const suspension = this.getResponseProperty("suspension");
|
||||
if (suspension != null) {
|
||||
this.suspension = new SubscriptionSuspensionResponse(suspension);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
import { BaseResponse } from "@bitwarden/common/models/response/base.response";
|
||||
|
||||
export class SubscriptionSuspensionResponse extends BaseResponse {
|
||||
suspensionDate: string;
|
||||
unpaidPeriodEndDate: string;
|
||||
gracePeriod: number;
|
||||
|
||||
constructor(response: any) {
|
||||
super(response);
|
||||
|
||||
this.suspensionDate = this.getResponseProperty("suspensionDate");
|
||||
this.unpaidPeriodEndDate = this.getResponseProperty("unpaidPeriodEndDate");
|
||||
this.gracePeriod = this.getResponseProperty("gracePeriod");
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user