website cleanup
This commit is contained in:
@@ -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();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user