view data fixes
This commit is contained in:
@@ -0,0 +1,8 @@
|
||||
import { describe, it, expect } from 'vitest';
|
||||
import { PenaltiesApiClient } from './PenaltiesApiClient';
|
||||
|
||||
describe('PenaltiesApiClient', () => {
|
||||
it('should be defined', () => {
|
||||
expect(PenaltiesApiClient).toBeDefined();
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,26 @@
|
||||
import { BaseApiClient } from '../base/BaseApiClient';
|
||||
import { RacePenaltiesDTO } from '../../types/generated/RacePenaltiesDTO';
|
||||
import { ApplyPenaltyCommandDTO } from '../../types/generated/ApplyPenaltyCommandDTO';
|
||||
import type { PenaltyTypesReferenceDTO } from '../../types/PenaltyTypesReferenceDTO';
|
||||
|
||||
/**
|
||||
* Penalties API Client
|
||||
*
|
||||
* Handles all penalty-related API operations.
|
||||
*/
|
||||
export class PenaltiesApiClient extends BaseApiClient {
|
||||
/** Get penalties for a race */
|
||||
getRacePenalties(raceId: string): Promise<RacePenaltiesDTO> {
|
||||
return this.get<RacePenaltiesDTO>(`/races/${raceId}/penalties`);
|
||||
}
|
||||
|
||||
/** Get allowed penalty types and semantics */
|
||||
getPenaltyTypesReference(): Promise<PenaltyTypesReferenceDTO> {
|
||||
return this.get<PenaltyTypesReferenceDTO>('/races/reference/penalty-types');
|
||||
}
|
||||
|
||||
/** Apply a penalty */
|
||||
applyPenalty(input: ApplyPenaltyCommandDTO): Promise<void> {
|
||||
return this.post<void>('/races/penalties/apply', input);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user