module cleanup

This commit is contained in:
2025-12-19 01:22:45 +01:00
parent d617654928
commit d0fac9e6c1
135 changed files with 5104 additions and 1315 deletions

View File

@@ -1,6 +1,7 @@
import { Result } from '@core/shared/application/Result';
import type { ApplicationErrorCode } from '@core/shared/errors/ApplicationErrorCode';
import type { ILeagueMembershipRepository } from '../../domain/repositories/ILeagueMembershipRepository';
import type { UpdateLeagueMemberRoleResultDTO } from '../presenters/IUpdateLeagueMemberRolePresenter';
export interface UpdateLeagueMemberRoleUseCaseParams {
leagueId: string;
@@ -11,7 +12,7 @@ export interface UpdateLeagueMemberRoleUseCaseParams {
export class UpdateLeagueMemberRoleUseCase {
constructor(private readonly leagueMembershipRepository: ILeagueMembershipRepository) {}
async execute(params: UpdateLeagueMemberRoleUseCaseParams): Promise<Result<void, ApplicationErrorCode<'MEMBERSHIP_NOT_FOUND'>>> {
async execute(params: UpdateLeagueMemberRoleUseCaseParams): Promise<Result<UpdateLeagueMemberRoleResultDTO, ApplicationErrorCode<'MEMBERSHIP_NOT_FOUND'>>> {
const memberships = await this.leagueMembershipRepository.getLeagueMembers(params.leagueId);
const membership = memberships.find(m => m.driverId === params.targetDriverId);
if (!membership) {
@@ -21,6 +22,6 @@ export class UpdateLeagueMemberRoleUseCase {
...membership,
role: params.newRole,
});
return Result.ok(undefined);
return Result.ok({ success: true });
}
}