view data fixes
This commit is contained in:
23
apps/website/lib/view-models/BillingStatsViewModel.ts
Normal file
23
apps/website/lib/view-models/BillingStatsViewModel.ts
Normal 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; }
|
||||
}
|
||||
Reference in New Issue
Block a user