import { BaseApiClient } from '../base/BaseApiClient'; // Import generated types import type { CompleteOnboardingInputDTO, CompleteOnboardingOutputDTO, DriverRegistrationStatusDTO, DriverLeaderboardItemDTO, DriverProfileDTO } from '../../types/generated'; // TODO: Create proper DriverDTO in generated types type DriverDTO = { id: string; name: string; avatarUrl?: string; iracingId?: string; rating?: number; }; type DriversLeaderboardDto = { drivers: DriverLeaderboardItemDTO[]; }; /** * Drivers API Client * * Handles all driver-related API operations. */ export class DriversApiClient extends BaseApiClient { /** Get drivers leaderboard */ getLeaderboard(): Promise { return this.get('/drivers/leaderboard'); } /** Complete driver onboarding */ completeOnboarding(input: CompleteOnboardingInputDTO): Promise { return this.post('/drivers/complete-onboarding', input); } /** Get current driver (based on session) */ getCurrent(): Promise { return this.get('/drivers/current'); } /** Get driver registration status for a specific race */ getRegistrationStatus(driverId: string, raceId: string): Promise { return this.get(`/drivers/${driverId}/races/${raceId}/registration-status`); } /** Get driver by ID */ getDriver(driverId: string): Promise { return this.get(`/drivers/${driverId}`); } /** Get driver profile with full details */ getDriverProfile(driverId: string): Promise { return this.get(`/drivers/${driverId}/profile`); } }