wip
This commit is contained in:
@@ -1,12 +1,7 @@
|
||||
import type { IRaceRegistrationRepository } from '@gridpilot/racing/domain/repositories/IRaceRegistrationRepository';
|
||||
import type { ILeagueMembershipRepository } from '@gridpilot/racing/domain/repositories/ILeagueMembershipRepository';
|
||||
import type { RaceRegistration } from '@gridpilot/racing/domain/entities/RaceRegistration';
|
||||
|
||||
export interface RegisterForRaceCommand {
|
||||
raceId: string;
|
||||
leagueId: string;
|
||||
driverId: string;
|
||||
}
|
||||
import type { RegisterForRaceCommandDTO } from '../dto/RegisterForRaceCommandDTO';
|
||||
|
||||
export class RegisterForRaceUseCase {
|
||||
constructor(
|
||||
@@ -20,7 +15,7 @@ export class RegisterForRaceUseCase {
|
||||
* - validates active league membership
|
||||
* - registers driver for race
|
||||
*/
|
||||
async execute(command: RegisterForRaceCommand): Promise<void> {
|
||||
async execute(command: RegisterForRaceCommandDTO): Promise<void> {
|
||||
const { raceId, leagueId, driverId } = command;
|
||||
|
||||
const alreadyRegistered = await this.registrationRepository.isRegistered(raceId, driverId);
|
||||
|
||||
Reference in New Issue
Block a user