view data fixes
This commit is contained in:
22
apps/website/lib/view-models/PaymentMethodViewModel.ts
Normal file
22
apps/website/lib/view-models/PaymentMethodViewModel.ts
Normal file
@@ -0,0 +1,22 @@
|
||||
import { ViewModel } from "../contracts/view-models/ViewModel";
|
||||
import type { PaymentMethodViewData } from "@/lib/view-data/BillingViewData";
|
||||
|
||||
export class PaymentMethodViewModel extends ViewModel {
|
||||
private readonly data: PaymentMethodViewData;
|
||||
|
||||
constructor(data: PaymentMethodViewData) {
|
||||
super();
|
||||
this.data = data;
|
||||
}
|
||||
|
||||
get id(): string { return this.data.id; }
|
||||
get type(): string { return this.data.type; }
|
||||
get last4(): string { return this.data.last4; }
|
||||
get brand(): string | undefined { return this.data.brand; }
|
||||
get isDefault(): boolean { return this.data.isDefault; }
|
||||
get expiryMonth(): number | undefined { return this.data.expiryMonth; }
|
||||
get expiryYear(): number | undefined { return this.data.expiryYear; }
|
||||
get bankName(): string | undefined { return this.data.bankName; }
|
||||
get displayLabel(): string { return this.data.displayLabel; }
|
||||
get expiryDisplay(): string | null { return this.data.expiryDisplay; }
|
||||
}
|
||||
Reference in New Issue
Block a user