import type { ISeasonRepository } from '../../domain/repositories/ISeasonRepository'; import type { IGetLeagueSeasonsPresenter, GetLeagueSeasonsResultDTO, GetLeagueSeasonsViewModel } from '../presenters/IGetLeagueSeasonsPresenter'; import type { UseCase } from '@core/shared/application/UseCase'; export interface GetLeagueSeasonsUseCaseParams { leagueId: string; } export interface GetLeagueSeasonsResultDTO { seasons: unknown[]; } export class GetLeagueSeasonsUseCase implements UseCase { constructor(private readonly seasonRepository: ISeasonRepository) {} async execute(params: GetLeagueSeasonsUseCaseParams, presenter: IGetLeagueSeasonsPresenter): Promise { const seasons = await this.seasonRepository.findByLeagueId(params.leagueId); const dto: GetLeagueSeasonsResultDTO = { seasons }; presenter.reset(); presenter.present(dto); } }