import type { ILeagueMembershipRepository } from '../../domain/repositories/ILeagueMembershipRepository'; import { Result } from '@core/shared/application/Result'; import type { ApplicationErrorCode } from '@core/shared/errors/ApplicationErrorCode'; import type { AsyncUseCase } from '@core/shared/application'; export interface RejectLeagueJoinRequestUseCaseParams { requestId: string; } export interface RejectLeagueJoinRequestResultDTO { success: boolean; message: string; } export class RejectLeagueJoinRequestUseCase implements AsyncUseCase { constructor(private readonly leagueMembershipRepository: ILeagueMembershipRepository) {} async execute(params: RejectLeagueJoinRequestUseCaseParams): Promise>> { await this.leagueMembershipRepository.removeJoinRequest(params.requestId); const dto: RejectLeagueJoinRequestResultDTO = { success: true, message: 'Join request rejected.' }; return Result.ok(dto); } }