1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-14 07:13:32 +00:00

[AC-2721][Defect] Apply Subscription Status Updates in Provider Subscription details (#9484)

* Add status banner to the provider subscription page

* Add the isexpired method

* Add the unpaid status banner
This commit is contained in:
cyprain-okeke
2024-06-06 15:53:52 +01:00
committed by GitHub
parent a7b45a44e3
commit 0f9f7f4df6
5 changed files with 231 additions and 23 deletions

View File

@@ -4,6 +4,10 @@ export class ProviderSubscriptionResponse extends BaseResponse {
status: string;
currentPeriodEndDate: Date;
discountPercentage?: number | null;
collectionMethod: string;
unpaidPeriodEndDate?: string;
gracePeriod?: number | null;
suspensionDate?: string;
plans: Plans[] = [];
constructor(response: any) {
@@ -11,6 +15,10 @@ export class ProviderSubscriptionResponse extends BaseResponse {
this.status = this.getResponseProperty("status");
this.currentPeriodEndDate = new Date(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");
const plans = this.getResponseProperty("plans");
if (plans != null) {
this.plans = plans.map((i: any) => new Plans(i));