mirror of
https://github.com/bitwarden/browser
synced 2025-12-22 19:23:52 +00:00
[PM-5971] Fix Payment Method Warning Bugs (#7923)
* Rework implementation of payment method warnings * Move payment-method-warnings.component to module * Moved timer/subscribe to app.component * Remove unrelated refactoring * Remaining feedback * Add paymentMethodWarningsService tests * Thomas' feedback * fix tests * Use barrel file imports * Make banner work with new vault navigation * Matt's feedback
This commit is contained in:
13
libs/common/src/billing/models/billing-keys.state.ts
Normal file
13
libs/common/src/billing/models/billing-keys.state.ts
Normal file
@@ -0,0 +1,13 @@
|
||||
import { BILLING_DISK, KeyDefinition } from "../../platform/state";
|
||||
import { PaymentMethodWarning } from "../models/domain/payment-method-warning";
|
||||
|
||||
export const PAYMENT_METHOD_WARNINGS_KEY = KeyDefinition.record<PaymentMethodWarning>(
|
||||
BILLING_DISK,
|
||||
"paymentMethodWarnings",
|
||||
{
|
||||
deserializer: (warnings) => ({
|
||||
...warnings,
|
||||
savedAt: new Date(warnings.savedAt),
|
||||
}),
|
||||
},
|
||||
);
|
||||
@@ -0,0 +1,6 @@
|
||||
export type PaymentMethodWarning = {
|
||||
organizationName: string;
|
||||
risksSubscriptionFailure: boolean;
|
||||
acknowledged: boolean;
|
||||
savedAt: Date;
|
||||
};
|
||||
@@ -0,0 +1,15 @@
|
||||
import { BaseResponse } from "../../../models/response/base.response";
|
||||
|
||||
export class OrganizationBillingStatusResponse extends BaseResponse {
|
||||
organizationId: string;
|
||||
organizationName: string;
|
||||
risksSubscriptionFailure: boolean;
|
||||
|
||||
constructor(response: any) {
|
||||
super(response);
|
||||
|
||||
this.organizationId = this.getResponseProperty("OrganizationId");
|
||||
this.organizationName = this.getResponseProperty("OrganizationName");
|
||||
this.risksSubscriptionFailure = this.getResponseProperty("RisksSubscriptionFailure");
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user