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

@@ -74,7 +74,7 @@ export class GetRaceDetailUseCase {
? registrations.some(reg => reg.driverId.toString() === driverId)
: false;
const isUpcoming = race.status === 'scheduled' && race.scheduledAt > new Date();
const isUpcoming = race.status.isScheduled() && race.scheduledAt > new Date();
const canRegister =
typeof driverId === 'string' && driverId.length > 0
? !!membership && membership.status.toString() === 'active' && isUpcoming
@@ -82,7 +82,7 @@ export class GetRaceDetailUseCase {
let userResult: RaceResult | null = null;
if (race.status === 'completed' && typeof driverId === 'string' && driverId.length > 0) {
if (race.status.isCompleted() && typeof driverId === 'string' && driverId.length > 0) {
const results = await this.resultRepository.findByRaceId(race.id);
userResult = results.find(r => r.driverId.toString() === driverId) ?? null;
}