Files
gridpilot.gg/core/leagues/application/use-cases/LeaveLeagueUseCase.ts
2026-01-26 01:36:22 +01:00

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);
}
}