view models

This commit is contained in:
2025-12-18 00:08:47 +01:00
parent f7a56a92ce
commit 7c449af311
56 changed files with 2594 additions and 206 deletions

View File

@@ -1,15 +1,20 @@
import { MembershipFeeDto } from '../dtos';
import { MembershipFeeDto } from '../types/generated/MembershipFeeDto';
export class MembershipFeeViewModel implements MembershipFeeDto {
id: string;
leagueId: string;
amount: number;
currency: string;
period: string;
constructor(dto: MembershipFeeDto) {
Object.assign(this, dto);
this.id = dto.id;
this.leagueId = dto.leagueId;
}
// Note: The generated DTO is incomplete
// These fields will need to be added when the OpenAPI spec is updated
amount: number = 0;
currency: string = 'USD';
period: string = 'monthly';
/** UI-specific: Formatted amount */
get formattedAmount(): string {
return `${this.currency} ${this.amount.toFixed(2)}`;