import type { League } from '../../domain/entities/League';
import type { Season } from '../../domain/entities/Season';
import type { LeagueScoringConfig } from '../../domain/entities/LeagueScoringConfig';
import type { Game } from '../../domain/entities/Game';
import type { Presenter } from '@core/shared/presentation';

export interface LeagueConfigFormViewModel {
  leagueId: string;
  basics: {
    name: string;
    description: string;
    visibility: string;
    gameId: string;
  };
  structure: {
    mode: string;
    maxDrivers: number;
    maxTeams?: number;
    driversPerTeam?: number;
    multiClassEnabled: boolean;
  };
  championships: {
    enableDriverChampionship: boolean;
    enableTeamChampionship: boolean;
    enableNationsChampionship: boolean;
    enableTrophyChampionship: boolean;
  };
  scoring: {
    patternId?: string;
    customScoringEnabled: boolean;
  };
  dropPolicy: {
    strategy: string;
    n?: number;
  };
  timings: {
    practiceMinutes: number;
    qualifyingMinutes: number;
    sprintRaceMinutes?: number;
    mainRaceMinutes: number;
    sessionCount: number;
    roundsPlanned: number;
  };
  stewarding: {
    decisionMode: string;
    requireDefense: boolean;
    defenseTimeLimit: number;
    voteTimeLimit: number;
    protestDeadlineHours: number;
    stewardingClosesHours: number;
    notifyAccusedOnProtest: boolean;
    notifyOnVoteRequired: boolean;
    requiredVotes?: number;
  };
}

export interface LeagueFullConfigData {
  league: League;
  activeSeason?: Season;
  scoringConfig?: LeagueScoringConfig;
  game?: Game;
}

export interface ILeagueFullConfigPresenter
  extends Presenter<LeagueFullConfigData, LeagueConfigFormViewModel> {}