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

@@ -7,7 +7,7 @@ import type { ILeagueRepository } from '@core/racing/domain/repositories/ILeague
import type {
MembershipRole,
} from '@core/racing/domain/entities/LeagueMembership';
import type { TransferLeagueOwnershipResultDTO } from '../presenters/ITransferLeagueOwnershipPresenter';
import type { TransferLeagueOwnershipOutputPort } from '../ports/output/TransferLeagueOwnershipOutputPort';
export interface TransferLeagueOwnershipCommandDTO {
leagueId: string;
@@ -23,7 +23,7 @@ export class TransferLeagueOwnershipUseCase {
private readonly membershipRepository: ILeagueMembershipRepository
) {}
async execute(command: TransferLeagueOwnershipCommandDTO): Promise<Result<void, ApplicationErrorCode<TransferLeagueOwnershipErrorCode>>> {
async execute(command: TransferLeagueOwnershipCommandDTO): Promise<Result<TransferLeagueOwnershipOutputPort, ApplicationErrorCode<TransferLeagueOwnershipErrorCode>>> {
const { leagueId, currentOwnerId, newOwnerId } = command;
const league = await this.leagueRepository.findById(leagueId);
@@ -57,6 +57,6 @@ export class TransferLeagueOwnershipUseCase {
const updatedLeague = league.update({ ownerId: newOwnerId });
await this.leagueRepository.update(updatedLeague);
return Result.ok(undefined);
return Result.ok({ success: true });
}
}