17 lines
669 B
TypeScript
17 lines
669 B
TypeScript
import { LeagueRepository } from '../ports/LeagueRepository';
|
|
import { DriverRepository } from '../../../racing/domain/repositories/DriverRepository';
|
|
import { EventPublisher } from '../../../shared/ports/EventPublisher';
|
|
import { LeaveLeagueCommand } from '../ports/LeaveLeagueCommand';
|
|
|
|
export class LeaveLeagueUseCase {
|
|
constructor(
|
|
private readonly leagueRepository: LeagueRepository,
|
|
private readonly driverRepository: DriverRepository,
|
|
private readonly eventPublisher: EventPublisher,
|
|
) {}
|
|
|
|
async execute(command: LeaveLeagueCommand): Promise<void> {
|
|
await this.leagueRepository.removeLeagueMember(command.leagueId, command.driverId);
|
|
}
|
|
}
|