wip league admin tools
This commit is contained in:
@@ -1,4 +1,12 @@
|
||||
import { LeagueScoringChampionshipDTO } from '@/lib/types/generated/LeagueScoringChampionshipDTO';
|
||||
export type LeagueScoringChampionshipViewModelInput = {
|
||||
id: string;
|
||||
name: string;
|
||||
type: string;
|
||||
sessionTypes: string[];
|
||||
pointsPreview?: Array<{ sessionType: string; position: number; points: number }> | null;
|
||||
bonusSummary?: string[] | null;
|
||||
dropPolicyDescription?: string;
|
||||
};
|
||||
|
||||
/**
|
||||
* LeagueScoringChampionshipViewModel
|
||||
@@ -14,13 +22,13 @@ export class LeagueScoringChampionshipViewModel {
|
||||
readonly bonusSummary: string[];
|
||||
readonly dropPolicyDescription?: string;
|
||||
|
||||
constructor(dto: LeagueScoringChampionshipDTO) {
|
||||
this.id = dto.id;
|
||||
this.name = dto.name;
|
||||
this.type = dto.type;
|
||||
this.sessionTypes = dto.sessionTypes;
|
||||
this.pointsPreview = (dto.pointsPreview as any) || [];
|
||||
this.bonusSummary = (dto as any).bonusSummary || [];
|
||||
this.dropPolicyDescription = (dto as any).dropPolicyDescription;
|
||||
constructor(input: LeagueScoringChampionshipViewModelInput) {
|
||||
this.id = input.id;
|
||||
this.name = input.name;
|
||||
this.type = input.type;
|
||||
this.sessionTypes = input.sessionTypes;
|
||||
this.pointsPreview = (input.pointsPreview as any) || [];
|
||||
this.bonusSummary = (input as any).bonusSummary || [];
|
||||
this.dropPolicyDescription = (input as any).dropPolicyDescription;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user