1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-10 13:23:34 +00:00

[PM-15814]Alert owners of reseller-managed orgs to renewal events (#12607)

* Changes for the reseller alert

* Resolve the null error

* Refactor the reseller service

* Fix the a failing test due to null date

* Fix the No overload matches error

* Resolve the null error

* Resolve the null error

* Resolve the null error

* Change the date format

* Remove unwanted comment

* Refactor changes

* Add the feature flag
This commit is contained in:
cyprain-okeke
2024-12-31 18:06:45 +01:00
committed by GitHub
parent 03d0957814
commit 899b16966a
6 changed files with 233 additions and 0 deletions

View File

@@ -6,6 +6,10 @@ export class OrganizationBillingMetadataResponse extends BaseResponse {
isOnSecretsManagerStandalone: boolean;
isSubscriptionUnpaid: boolean;
hasSubscription: boolean;
hasOpenInvoice: boolean;
invoiceDueDate: Date | null;
invoiceCreatedDate: Date | null;
subPeriodEndDate: Date | null;
constructor(response: any) {
super(response);
@@ -14,5 +18,14 @@ export class OrganizationBillingMetadataResponse extends BaseResponse {
this.isOnSecretsManagerStandalone = this.getResponseProperty("IsOnSecretsManagerStandalone");
this.isSubscriptionUnpaid = this.getResponseProperty("IsSubscriptionUnpaid");
this.hasSubscription = this.getResponseProperty("HasSubscription");
this.hasOpenInvoice = this.getResponseProperty("HasOpenInvoice");
this.invoiceDueDate = this.parseDate(this.getResponseProperty("InvoiceDueDate"));
this.invoiceCreatedDate = this.parseDate(this.getResponseProperty("InvoiceCreatedDate"));
this.subPeriodEndDate = this.parseDate(this.getResponseProperty("SubPeriodEndDate"));
}
private parseDate(dateString: any): Date | null {
return dateString ? new Date(dateString) : null;
}
}

View File

@@ -43,6 +43,7 @@ export enum FeatureFlag {
PM11360RemoveProviderExportPermission = "pm-11360-remove-provider-export-permission",
PM12443RemovePagingLogic = "pm-12443-remove-paging-logic",
PrivateKeyRegeneration = "pm-12241-private-key-regeneration",
ResellerManagedOrgAlert = "PM-15814-alert-owners-of-reseller-managed-orgs",
}
export type AllowedFeatureFlagTypes = boolean | number | string;
@@ -96,6 +97,7 @@ export const DefaultFeatureFlagValue = {
[FeatureFlag.PM11360RemoveProviderExportPermission]: FALSE,
[FeatureFlag.PM12443RemovePagingLogic]: FALSE,
[FeatureFlag.PrivateKeyRegeneration]: FALSE,
[FeatureFlag.ResellerManagedOrgAlert]: FALSE,
} satisfies Record<FeatureFlag, AllowedFeatureFlagTypes>;
export type DefaultFeatureFlagValueType = typeof DefaultFeatureFlagValue;