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

24 lines
1.2 KiB
TypeScript

import type { BillingStatsViewData } from "@/lib/view-data/BillingViewData";
import { ViewModel } from "../contracts/view-models/ViewModel";
export class BillingStatsViewModel extends ViewModel {
private readonly data: BillingStatsViewData;
constructor(data: BillingStatsViewData) {
super();
this.data = data;
}
get totalSpent(): number { return this.data.totalSpent; }
get pendingAmount(): number { return this.data.pendingAmount; }
get nextPaymentDate(): string { return this.data.nextPaymentDate; }
get nextPaymentAmount(): number { return this.data.nextPaymentAmount; }
get activeSponsorships(): number { return this.data.activeSponsorships; }
get averageMonthlySpend(): number { return this.data.averageMonthlySpend; }
get totalSpentDisplay(): string { return this.data.formattedTotalSpent; }
get pendingAmountDisplay(): string { return this.data.formattedPendingAmount; }
get nextPaymentAmountDisplay(): string { return this.data.formattedNextPaymentAmount; }
get averageMonthlySpendDisplay(): string { return this.data.formattedAverageMonthlySpend; }
get nextPaymentDateDisplay(): string { return this.data.formattedNextPaymentDate; }
}