view data fixes

This commit is contained in:
2026-01-23 15:30:23 +01:00
parent e22033be38
commit f8099f04bc
213 changed files with 3466 additions and 3003 deletions

View File

@@ -0,0 +1,23 @@
import { ViewModel } from "../contracts/view-models/ViewModel";
import type { BillingStatsViewData } from "@/lib/view-data/BillingViewData";
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; }
}