wip league admin tools

This commit is contained in:
2025-12-28 12:04:12 +01:00
parent 5dc8c2399c
commit 6edf12fda8
401 changed files with 15365 additions and 6047 deletions

View File

@@ -71,7 +71,17 @@ export class GetLeagueScoringConfigUseCase {
}
const activeSeason =
seasons.find((s) => s.status === 'active') ?? seasons[0];
seasons.find((s) => {
const seasonStatus = (s as unknown as { status?: unknown }).status;
if (typeof seasonStatus === 'string') return seasonStatus === 'active';
if (seasonStatus && typeof (seasonStatus as { isActive?: unknown }).isActive === 'function') {
return (seasonStatus as { isActive: () => boolean }).isActive();
}
if (seasonStatus && typeof (seasonStatus as { toString?: unknown }).toString === 'function') {
return (seasonStatus as { toString: () => string }).toString() === 'active';
}
return false;
}) ?? seasons[0];
if (!activeSeason) {
return Result.err({