refactor use cases
This commit is contained in:
@@ -10,7 +10,6 @@ import type { IWalletRepository } from '@core/payments/domain/repositories/IWall
|
||||
import type { Logger } from '@core/shared/application';
|
||||
import { Result } from '@core/shared/application/Result';
|
||||
import type { ApplicationErrorCode } from '@core/shared/errors/ApplicationErrorCode';
|
||||
import type { UseCaseOutputPort } from '@core/shared/application/UseCaseOutputPort';
|
||||
import { SeasonSponsorship } from '../../domain/entities/season/SeasonSponsorship';
|
||||
import type { ILeagueWalletRepository } from '../../domain/repositories/ILeagueWalletRepository';
|
||||
import type { ISeasonRepository } from '../../domain/repositories/ISeasonRepository';
|
||||
@@ -54,14 +53,13 @@ export class AcceptSponsorshipRequestUseCase {
|
||||
private readonly walletRepository: IWalletRepository,
|
||||
private readonly leagueWalletRepository: ILeagueWalletRepository,
|
||||
private readonly logger: Logger,
|
||||
private readonly output: UseCaseOutputPort<AcceptSponsorshipResult>,
|
||||
) {}
|
||||
|
||||
async execute(
|
||||
input: AcceptSponsorshipRequestInput,
|
||||
): Promise<
|
||||
Result<
|
||||
void,
|
||||
AcceptSponsorshipResult,
|
||||
ApplicationErrorCode<
|
||||
| 'SPONSORSHIP_REQUEST_NOT_FOUND'
|
||||
| 'SPONSORSHIP_REQUEST_NOT_PENDING'
|
||||
@@ -212,8 +210,6 @@ export class AcceptSponsorshipRequestUseCase {
|
||||
netAmount: acceptedRequest.getNetAmount().amount,
|
||||
};
|
||||
|
||||
this.output.present(result);
|
||||
|
||||
return Result.ok(undefined);
|
||||
return Result.ok(result);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user