rename to core

This commit is contained in:
2025-12-15 13:46:07 +01:00
parent aedf58643d
commit 5c22f8820c
559 changed files with 415 additions and 767 deletions

View File

@@ -0,0 +1,22 @@
import type { IRaceRegistrationRepository } from '@gridpilot/racing/domain/repositories/IRaceRegistrationRepository';
import type { WithdrawFromRaceCommandDTO } from '../dto/WithdrawFromRaceCommandDTO';
/**
* Mirrors legacy withdrawFromRace behavior:
* - throws when driver is not registered
* - removes registration and cleans up empty race sets
*
* The repository encapsulates the in-memory or persistent details.
*/
export class WithdrawFromRaceUseCase {
constructor(
private readonly registrationRepository: IRaceRegistrationRepository,
) {}
async execute(command: WithdrawFromRaceCommandDTO): Promise<void> {
const { raceId, driverId } = command;
// Let repository enforce "not registered" error behavior to match legacy logic.
await this.registrationRepository.withdraw(raceId, driverId);
}
}