website refactor
This commit is contained in:
@@ -10,8 +10,28 @@ export class LeagueConfigPresenter implements UseCaseOutputPort<GetLeagueFullCon
|
||||
}
|
||||
|
||||
present(result: GetLeagueFullConfigResult): void {
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
const dto = result.config as any;
|
||||
const dto = result.config as unknown as {
|
||||
league: { id: string; name: string; description: string; settings: { pointsSystem: string } };
|
||||
activeSeason?: {
|
||||
stewardingConfig?: {
|
||||
decisionMode: string;
|
||||
requireDefense: boolean;
|
||||
defenseTimeLimit: number;
|
||||
voteTimeLimit: number;
|
||||
protestDeadlineHours: number;
|
||||
stewardingClosesHours: number;
|
||||
notifyAccusedOnProtest: boolean;
|
||||
notifyOnVoteRequired: boolean;
|
||||
requiredVotes?: number;
|
||||
};
|
||||
dropPolicy?: { strategy: string; n?: number };
|
||||
schedule?: {
|
||||
startDate?: Date;
|
||||
timeOfDay?: { hour: number; minute: number };
|
||||
};
|
||||
};
|
||||
scoringConfig?: { championships: { sessionTypes: string[]; pointsTableBySessionType: Record<string, { getPointsForPosition: (pos: number) => number }> }[] };
|
||||
};
|
||||
const league = dto.league;
|
||||
const settings = league.settings;
|
||||
const stewarding = dto.activeSeason?.stewardingConfig;
|
||||
@@ -53,7 +73,7 @@ export class LeagueConfigPresenter implements UseCaseOutputPort<GetLeagueFullCon
|
||||
},
|
||||
dropPolicy: {
|
||||
strategy: dropPolicy?.strategy === 'none' ? 'none' : 'worst_n',
|
||||
n: dropPolicy?.n,
|
||||
...(dropPolicy?.n !== undefined ? { n: dropPolicy.n } : {}),
|
||||
},
|
||||
timings: {
|
||||
raceDayOfWeek,
|
||||
@@ -69,7 +89,7 @@ export class LeagueConfigPresenter implements UseCaseOutputPort<GetLeagueFullCon
|
||||
stewardingClosesHours: stewarding?.stewardingClosesHours ?? 168,
|
||||
notifyAccusedOnProtest: stewarding?.notifyAccusedOnProtest ?? true,
|
||||
notifyOnVoteRequired: stewarding?.notifyOnVoteRequired ?? true,
|
||||
requiredVotes: stewarding?.requiredVotes,
|
||||
...(stewarding?.requiredVotes !== undefined ? { requiredVotes: stewarding.requiredVotes } : {}),
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user