refactor league module (wip)

This commit is contained in:
2025-12-22 15:47:47 +01:00
parent 03dc81b0ba
commit f59e1b13e7
10 changed files with 444 additions and 819 deletions

View File

@@ -0,0 +1,24 @@
import type { UseCaseOutputPort } from '@core/shared/application';
import type { WithdrawFromLeagueWalletResult } from '@core/racing/application/use-cases/WithdrawFromLeagueWalletUseCase';
import { WithdrawFromLeagueWalletOutputDTO } from '../dtos/WithdrawFromLeagueWalletOutputDTO';
export class WithdrawFromLeagueWalletPresenter implements UseCaseOutputPort<WithdrawFromLeagueWalletResult> {
private model: WithdrawFromLeagueWalletOutputDTO | null = null;
present(result: WithdrawFromLeagueWalletResult): void {
this.model = {
success: true,
message: `Successfully withdrew ${result.amount.amount} ${result.amount.currency} from league wallet. Transaction ID: ${result.transactionId}`,
};
}
getResponseModel(): WithdrawFromLeagueWalletOutputDTO {
if (!this.model) throw new Error('Presenter not presented');
return this.model;
}
get responseModel(): WithdrawFromLeagueWalletOutputDTO {
if (!this.model) throw new Error('Presenter not presented');
return this.model;
}
}