Files
gridpilot.gg/apps/website/lib/view-models/InvoiceViewModel.ts
2026-01-23 15:30:23 +01:00

28 lines
1.2 KiB
TypeScript

import { ViewModel } from "../contracts/view-models/ViewModel";
import type { InvoiceViewData } from "@/lib/view-data/BillingViewData";
export class InvoiceViewModel extends ViewModel {
private readonly data: InvoiceViewData;
constructor(data: InvoiceViewData) {
super();
this.data = data;
}
get id(): string { return this.data.id; }
get invoiceNumber(): string { return this.data.invoiceNumber; }
get date(): string { return this.data.date; }
get dueDate(): string { return this.data.dueDate; }
get amount(): number { return this.data.amount; }
get vatAmount(): number { return this.data.vatAmount; }
get totalAmount(): number { return this.data.totalAmount; }
get status(): string { return this.data.status; }
get description(): string { return this.data.description; }
get sponsorshipType(): string { return this.data.sponsorshipType; }
get pdfUrl(): string { return this.data.pdfUrl; }
get totalAmountFormatted(): string { return this.data.formattedTotalAmount; }
get vatAmountFormatted(): string { return this.data.formattedVatAmount; }
get dateFormatted(): string { return this.data.formattedDate; }
get isOverdue(): boolean { return this.data.isOverdue; }
}