Files
gridpilot.gg/apps/website/lib/view-models/PaymentMethodViewModel.ts
2026-01-24 01:25:46 +01:00

23 lines
949 B
TypeScript

import type { PaymentMethodViewData } from "@/lib/view-data/BillingViewData";
import { ViewModel } from "../contracts/view-models/ViewModel";
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; }
}