resolve manual DTOs

This commit is contained in:
2025-12-18 22:19:40 +01:00
parent 4a3087ae35
commit d617654928
179 changed files with 3716 additions and 1257 deletions

View File

@@ -1,15 +1,6 @@
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;
};
import type { CompleteOnboardingInputDTO, CompleteOnboardingOutputDTO, DriverRegistrationStatusDTO, DriverLeaderboardItemDTO, DriverProfileDTO, GetDriverOutputDTO } from '../../types/generated';
type DriversLeaderboardDto = {
drivers: DriverLeaderboardItemDTO[];
@@ -32,8 +23,8 @@ export class DriversApiClient extends BaseApiClient {
}
/** Get current driver (based on session) */
getCurrent(): Promise<DriverDTO | null> {
return this.get<DriverDTO | null>('/drivers/current');
getCurrent(): Promise<GetDriverOutputDTO | null> {
return this.get<GetDriverOutputDTO | null>('/drivers/current');
}
/** Get driver registration status for a specific race */
@@ -42,8 +33,8 @@ export class DriversApiClient extends BaseApiClient {
}
/** Get driver by ID */
getDriver(driverId: string): Promise<DriverDTO | null> {
return this.get<DriverDTO | null>(`/drivers/${driverId}`);
getDriver(driverId: string): Promise<GetDriverOutputDTO | null> {
return this.get<GetDriverOutputDTO | null>(`/drivers/${driverId}`);
}
/** Get driver profile with full details */
@@ -52,7 +43,7 @@ export class DriversApiClient extends BaseApiClient {
}
/** Update current driver profile */
updateProfile(updates: { bio?: string; country?: string }): Promise<DriverDTO> {
return this.put<DriverDTO>('/drivers/profile', updates);
updateProfile(updates: { bio?: string; country?: string }): Promise<GetDriverOutputDTO> {
return this.put<GetDriverOutputDTO>('/drivers/profile', updates);
}
}