refactor core presenters

This commit is contained in:
2025-12-19 19:42:19 +01:00
parent 8116fe888f
commit 94fc538f44
228 changed files with 2817 additions and 3097 deletions

View File

@@ -1,7 +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';
import type { UpdateLeagueMemberRoleOutputPort } from '../ports/output/UpdateLeagueMemberRoleOutputPort';
export interface UpdateLeagueMemberRoleUseCaseParams {
leagueId: string;
@@ -12,7 +12,7 @@ export interface UpdateLeagueMemberRoleUseCaseParams {
export class UpdateLeagueMemberRoleUseCase {
constructor(private readonly leagueMembershipRepository: ILeagueMembershipRepository) {}
async execute(params: UpdateLeagueMemberRoleUseCaseParams): Promise<Result<UpdateLeagueMemberRoleResultDTO, ApplicationErrorCode<'MEMBERSHIP_NOT_FOUND'>>> {
async execute(params: UpdateLeagueMemberRoleUseCaseParams): Promise<Result<UpdateLeagueMemberRoleOutputPort, ApplicationErrorCode<'MEMBERSHIP_NOT_FOUND'>>> {
const memberships = await this.leagueMembershipRepository.getLeagueMembers(params.leagueId);
const membership = memberships.find(m => m.driverId === params.targetDriverId);
if (!membership) {