website cleanup

This commit is contained in:
2025-12-25 00:19:36 +01:00
parent d78854a4c6
commit 9486455b9e
82 changed files with 1223 additions and 363 deletions

View File

@@ -1,21 +1,32 @@
import type { PrizeDto } from '../types/generated';
import type { PrizeDTO } from '../types/generated/PrizeDTO';
export class PrizeViewModel {
id: string;
leagueId: string;
seasonId: string;
position: number;
name: string;
amount: number;
type: string;
id!: string;
leagueId!: string;
seasonId!: string;
position!: number;
name!: string;
amount!: number;
type!: string;
description?: string;
awarded: boolean;
awarded!: boolean;
awardedTo?: string;
awardedAt?: Date;
createdAt: Date;
createdAt!: Date;
constructor(dto: PrizeDto) {
Object.assign(this, dto);
constructor(dto: PrizeDTO) {
this.id = dto.id;
this.leagueId = dto.leagueId;
this.seasonId = dto.seasonId;
this.position = dto.position;
this.name = dto.name;
this.amount = dto.amount;
this.type = dto.type;
this.description = dto.description;
this.awarded = dto.awarded;
this.awardedTo = dto.awardedTo;
this.awardedAt = dto.awardedAt ? new Date(dto.awardedAt) : undefined;
this.createdAt = new Date(dto.createdAt);
}
/** UI-specific: Formatted amount */
@@ -67,4 +78,4 @@ export class PrizeViewModel {
get formattedCreatedAt(): string {
return this.createdAt.toLocaleString();
}
}
}