refactor core presenters

This commit is contained in:
2025-12-19 19:42:19 +01:00
parent 8116fe888f
commit 94fc538f44
228 changed files with 2817 additions and 3097 deletions

View File

@@ -4,7 +4,7 @@ import type { ISeasonRepository } from '../../domain/repositories/ISeasonReposit
import type { ILeagueScoringConfigRepository } from '../../domain/repositories/ILeagueScoringConfigRepository';
import type { IGameRepository } from '../../domain/repositories/IGameRepository';
import type { LeagueScoringPresetProvider } from '../ports/LeagueScoringPresetProvider';
import type { LeagueEnrichedData } from '../presenters/IAllLeaguesWithCapacityAndScoringPresenter';
import type { LeagueEnrichedData, AllLeaguesWithCapacityAndScoringOutputPort } from '../ports/output/AllLeaguesWithCapacityAndScoringOutputPort';
import { Result } from '@core/shared/application/Result';
/**
@@ -22,7 +22,7 @@ export class GetAllLeaguesWithCapacityAndScoringUseCase
private readonly presetProvider: LeagueScoringPresetProvider,
) {}
async execute(): Promise<Result<LeagueEnrichedData[]>> {
async execute(): Promise<Result<AllLeaguesWithCapacityAndScoringOutputPort>> {
const leagues = await this.leagueRepository.findAll();
const enrichedLeagues: LeagueEnrichedData[] = [];
@@ -72,7 +72,7 @@ export class GetAllLeaguesWithCapacityAndScoringUseCase
...(preset ? { preset } : {}),
});
}
return Result.ok(enrichedLeagues);
return Result.ok({ leagues: enrichedLeagues });
}
}