api client refactor

This commit is contained in:
2025-12-17 18:01:47 +01:00
parent bab55955e1
commit 4177644b18
190 changed files with 6403 additions and 1624 deletions

View File

@@ -0,0 +1,36 @@
import { DriverRegistrationStatusDto } from '../dtos';
export class DriverRegistrationStatusViewModel implements DriverRegistrationStatusDto {
isRegistered: boolean;
raceId: string;
driverId: string;
constructor(dto: DriverRegistrationStatusDto) {
Object.assign(this, dto);
}
/** UI-specific: Status message */
get statusMessage(): string {
return this.isRegistered ? 'Registered for this race' : 'Not registered';
}
/** UI-specific: Status color */
get statusColor(): string {
return this.isRegistered ? 'green' : 'red';
}
/** UI-specific: Badge variant */
get statusBadgeVariant(): string {
return this.isRegistered ? 'success' : 'warning';
}
/** UI-specific: Registration button text */
get registrationButtonText(): string {
return this.isRegistered ? 'Withdraw' : 'Register';
}
/** UI-specific: Whether can register (assuming always can if not registered) */
get canRegister(): boolean {
return !this.isRegistered;
}
}