import { BaseApiClient } from '../base/BaseApiClient'; import type { CompleteOnboardingInputDTO } from '../../types/generated/CompleteOnboardingInputDTO'; import type { CompleteOnboardingOutputDTO } from '../../types/generated/CompleteOnboardingOutputDTO'; import type { DriverRegistrationStatusDTO } from '../../types/generated/DriverRegistrationStatusDTO'; import type { DriverLeaderboardItemDTO } from '../../types/generated/DriverLeaderboardItemDTO'; import type { GetDriverOutputDTO } from '../../types/generated/GetDriverOutputDTO'; import type { GetDriverProfileOutputDTO } from '../../types/generated/GetDriverProfileOutputDTO'; 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', { allowUnauthenticated: true, retry: false }); } /** 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`); } /** Update current driver profile */ updateProfile(updates: { bio?: string; country?: string }): Promise { return this.put('/drivers/profile', updates); } }