refactor use cases

This commit is contained in:
2026-01-08 15:34:51 +01:00
parent d984ab24a8
commit 52e9a2f6a7
362 changed files with 5192 additions and 8409 deletions

View File

@@ -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);
}
}
}