refactor league module (wip)

This commit is contained in:
2025-12-22 12:57:10 +01:00
parent 9da528d5bd
commit 03dc81b0ba
39 changed files with 546 additions and 405 deletions

View File

@@ -1,17 +1,18 @@
import type { JoinLeagueOutputPort } from '@core/racing/application/ports/output/JoinLeagueOutputPort';
import type { UseCaseOutputPort } from '@core/shared/application/UseCaseOutputPort';
import type { JoinLeagueResult } from '@core/racing/application/use-cases/JoinLeagueUseCase';
import type { JoinLeagueOutputDTO } from '../dtos/JoinLeagueOutputDTO';
export class JoinLeaguePresenter {
export class JoinLeaguePresenter implements UseCaseOutputPort<JoinLeagueResult> {
private result: JoinLeagueOutputDTO | null = null;
reset() {
this.result = null;
}
present(output: JoinLeagueOutputPort) {
present(result: JoinLeagueResult): void {
this.result = {
success: true,
membershipId: output.membershipId,
membershipId: result.membership.id.toString(),
};
}