import type { AdminVoteSession } from '../entities/AdminVoteSession';

/**
 * Repository Interface: AdminVoteSessionRepository
 * 
 * Port for persisting and retrieving admin vote sessions.
 * Sessions are scoped to leagues and control voting windows.
 */

export interface AdminVoteSessionRepository {
  /**
   * Save a vote session
   */
  save(session: AdminVoteSession): Promise<AdminVoteSession>;
  
  /**
   * Find a vote session by ID
   */
  findById(id: string): Promise<AdminVoteSession | null>;
  
  /**
   * Find active vote sessions for an admin in a league
   * (within voting window and not closed)
   */
  findActiveForAdmin(adminId: string, leagueId: string): Promise<AdminVoteSession[]>;
  
  /**
   * Find all vote sessions for an admin in a league
   */
  findByAdminAndLeague(adminId: string, leagueId: string): Promise<AdminVoteSession[]>;
  
  /**
   * Find vote sessions by league
   */
  findByLeague(leagueId: string): Promise<AdminVoteSession[]>;
  
  /**
   * Find closed vote sessions ready for outcome processing
   * (closed but not yet processed into rating events)
   */
  findClosedUnprocessed(): Promise<AdminVoteSession[]>;
}
