/**
 * Team Rankings Query Port
 *
 * Defines the interface for querying team rankings data.
 * This is a read-only query with search, filter, and sort capabilities.
 */

/**
 * Query input for team rankings
 */
export interface TeamRankingsQuery {
  /**
   * Search term for filtering teams by name (case-insensitive)
   */
  search?: string;

  /**
   * Minimum rating filter
   */
  minRating?: number;

  /**
   * Minimum member count filter
   */
  minMemberCount?: number;

  /**
   * Sort field (default: rating)
   */
  sortBy?: 'rating' | 'name' | 'rank' | 'memberCount';

  /**
   * Sort order (default: desc)
   */
  sortOrder?: 'asc' | 'desc';

  /**
   * Page number (default: 1)
   */
  page?: number;

  /**
   * Number of results per page (default: 20)
   */
  limit?: number;
}

/**
 * Team entry for rankings
 */
export interface TeamRankingEntry {
  rank: number;
  id: string;
  name: string;
  rating: number;
  memberCount: number;
  raceCount: number;
}

/**
 * Pagination metadata
 */
export interface PaginationMetadata {
  total: number;
  page: number;
  limit: number;
  totalPages: number;
}

/**
 * Team rankings result
 */
export interface TeamRankingsResult {
  teams: TeamRankingEntry[];
  pagination: PaginationMetadata;
}
