refactor core presenters
This commit is contained in:
@@ -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 });
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user