This commit is contained in:
2025-12-04 15:15:24 +01:00
parent b7d5551ea7
commit c698a0b893
119 changed files with 1167 additions and 2652 deletions

View File

@@ -6,11 +6,7 @@ import type {
MembershipRole,
MembershipStatus,
} from '@gridpilot/racing/domain/entities/LeagueMembership';
export interface JoinLeagueCommand {
leagueId: string;
driverId: string;
}
import type { JoinLeagueCommandDTO } from '../dto/JoinLeagueCommandDTO';
export class JoinLeagueUseCase {
constructor(private readonly membershipRepository: ILeagueMembershipRepository) {}
@@ -22,7 +18,7 @@ export class JoinLeagueUseCase {
* - Throws when membership already exists for this league/driver.
* - Creates a new active membership with role "member" and current timestamp.
*/
async execute(command: JoinLeagueCommand): Promise<LeagueMembership> {
async execute(command: JoinLeagueCommandDTO): Promise<LeagueMembership> {
const { leagueId, driverId } = command;
const existing = await this.membershipRepository.getMembership(leagueId, driverId);