api client refactor

This commit is contained in:
2025-12-17 18:01:47 +01:00
parent bab55955e1
commit 4177644b18
190 changed files with 6403 additions and 1624 deletions

View File

@@ -0,0 +1,34 @@
import { PrizeDto } from '../dtos';
export class PrizeViewModel implements PrizeDto {
id: string;
name: string;
amount: number;
currency: string;
position?: number;
constructor(dto: PrizeDto) {
Object.assign(this, dto);
}
/** UI-specific: Formatted amount */
get formattedAmount(): string {
return `${this.currency} ${this.amount.toFixed(2)}`;
}
/** UI-specific: Position display */
get positionDisplay(): string {
if (!this.position) return 'Special';
switch (this.position) {
case 1: return '1st Place';
case 2: return '2nd Place';
case 3: return '3rd Place';
default: return `${this.position}th Place`;
}
}
/** UI-specific: Prize description */
get prizeDescription(): string {
return `${this.name} - ${this.formattedAmount}`;
}
}