29 lines
864 B
TypeScript
29 lines
864 B
TypeScript
import { BaseApiClient } from '../base/BaseApiClient';
|
|
import type {
|
|
DriversLeaderboardDto,
|
|
CompleteOnboardingInputDto,
|
|
CompleteOnboardingOutputDto,
|
|
DriverDto,
|
|
} from '../../dtos';
|
|
|
|
/**
|
|
* Drivers API Client
|
|
*
|
|
* Handles all driver-related API operations.
|
|
*/
|
|
export class DriversApiClient extends BaseApiClient {
|
|
/** Get drivers leaderboard */
|
|
getLeaderboard(): Promise<DriversLeaderboardDto> {
|
|
return this.get<DriversLeaderboardDto>('/drivers/leaderboard');
|
|
}
|
|
|
|
/** Complete driver onboarding */
|
|
completeOnboarding(input: CompleteOnboardingInputDto): Promise<CompleteOnboardingOutputDto> {
|
|
return this.post<CompleteOnboardingOutputDto>('/drivers/complete-onboarding', input);
|
|
}
|
|
|
|
/** Get current driver (based on session) */
|
|
getCurrent(): Promise<DriverDto | null> {
|
|
return this.get<DriverDto | null>('/drivers/current');
|
|
}
|
|
} |