view data fixes
This commit is contained in:
27
apps/website/lib/view-models/InvoiceViewModel.ts
Normal file
27
apps/website/lib/view-models/InvoiceViewModel.ts
Normal file
@@ -0,0 +1,27 @@
|
||||
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; }
|
||||
}
|
||||
Reference in New Issue
Block a user