/**
 * Dashboard Repository Port
 * 
 * Defines the interface for accessing dashboard-related data.
 * This is a read-only repository for dashboard data aggregation.
 */

/**
 * Driver data for dashboard display
 */
export interface DriverData {
  id: string;
  name: string;
  avatar?: string;
  rating: number;
  rank: number;
  starts: number;
  wins: number;
  podiums: number;
  leagues: number;
}

/**
 * Race data for upcoming races section
 */
export interface RaceData {
  id: string;
  trackName: string;
  carType: string;
  scheduledDate: Date;
  timeUntilRace?: string;
}

/**
 * League standing data for championship standings section
 */
export interface LeagueStandingData {
  leagueId: string;
  leagueName: string;
  position: number;
  points: number;
  totalDrivers: number;
}

/**
 * Activity data for recent activity feed
 */
export interface ActivityData {
  id: string;
  type: 'race_result' | 'league_invitation' | 'achievement' | 'other';
  description: string;
  timestamp: Date;
  status: 'success' | 'info' | 'warning' | 'error';
}

/**
 * Friend data for social section
 */
export interface FriendData {
  id: string;
  name: string;
  avatar?: string;
  rating: number;
}

/**
 * Dashboard Repository Interface
 * 
 * Provides access to all data needed for the dashboard.
 * Each method returns data for a specific driver.
 */
export interface DashboardRepository {
  /**
   * Find a driver by ID
   * @param driverId - The driver ID
   * @returns Driver data or null if not found
   */
  findDriverById(driverId: string): Promise<DriverData | null>;

  /**
   * Get upcoming races for a driver
   * @param driverId - The driver ID
   * @returns Array of upcoming races
   */
  getUpcomingRaces(driverId: string): Promise<RaceData[]>;

  /**
   * Get league standings for a driver
   * @param driverId - The driver ID
   * @returns Array of league standings
   */
  getLeagueStandings(driverId: string): Promise<LeagueStandingData[]>;

  /**
   * Get recent activity for a driver
   * @param driverId - The driver ID
   * @returns Array of recent activities
   */
  getRecentActivity(driverId: string): Promise<ActivityData[]>;

  /**
   * Get friends for a driver
   * @param driverId - The driver ID
   * @returns Array of friends
   */
  getFriends(driverId: string): Promise<FriendData[]>;
}
