view data fixes
This commit is contained in:
@@ -1,23 +1,16 @@
|
||||
import { LeagueScoringConfigDTO } from '@/lib/types/generated/LeagueScoringConfigDTO';
|
||||
import type { LeagueScoringChampionshipDTO } from '@/lib/types/generated/LeagueScoringChampionshipDTO';
|
||||
|
||||
/**
|
||||
* LeagueScoringConfigViewModel
|
||||
*
|
||||
* View model for league scoring configuration
|
||||
*/
|
||||
import { ViewModel } from "../contracts/view-models/ViewModel";
|
||||
import type { LeagueScoringConfigViewData } from "../view-data/LeagueScoringConfigViewData";
|
||||
|
||||
export class LeagueScoringConfigViewModel extends ViewModel {
|
||||
readonly gameName: string;
|
||||
readonly scoringPresetName?: string;
|
||||
readonly dropPolicySummary?: string;
|
||||
readonly championships?: LeagueScoringChampionshipDTO[];
|
||||
private readonly data: LeagueScoringConfigViewData;
|
||||
|
||||
constructor(dto: LeagueScoringConfigDTO) {
|
||||
this.gameName = dto.gameName;
|
||||
this.scoringPresetName = dto.scoringPresetName;
|
||||
this.dropPolicySummary = dto.dropPolicySummary;
|
||||
this.championships = dto.championships;
|
||||
constructor(data: LeagueScoringConfigViewData) {
|
||||
super();
|
||||
this.data = data;
|
||||
}
|
||||
|
||||
get gameName(): string { return this.data.gameName; }
|
||||
get scoringPresetName(): string | undefined { return this.data.scoringPresetName; }
|
||||
get dropPolicySummary(): string | undefined { return this.data.dropPolicySummary; }
|
||||
get championships(): any[] | undefined { return this.data.championships; }
|
||||
}
|
||||
Reference in New Issue
Block a user