website refactor
This commit is contained in:
41
apps/website/lib/services/protests/ProtestService.ts
Normal file
41
apps/website/lib/services/protests/ProtestService.ts
Normal file
@@ -0,0 +1,41 @@
|
||||
import { ProtestsApiClient } from '@/lib/api/protests/ProtestsApiClient';
|
||||
import type { ProtestViewModel } from '@/lib/view-models/ProtestViewModel';
|
||||
import type { RaceViewModel } from '@/lib/view-models/RaceViewModel';
|
||||
import type { ProtestDriverViewModel } from '@/lib/view-models/ProtestDriverViewModel';
|
||||
import type { ApplyPenaltyCommandDTO } from '@/lib/types/generated/ApplyPenaltyCommandDTO';
|
||||
import type { RequestProtestDefenseCommandDTO } from '@/lib/types/generated/RequestProtestDefenseCommandDTO';
|
||||
import type { ReviewProtestCommandDTO } from '@/lib/types/generated/ReviewProtestCommandDTO';
|
||||
|
||||
/**
|
||||
* Protest Service - DTO Only
|
||||
*
|
||||
* Returns raw API DTOs. No ViewModels or UX logic.
|
||||
* All client-side presentation logic must be handled by hooks/components.
|
||||
*/
|
||||
export class ProtestService {
|
||||
constructor(private readonly apiClient: ProtestsApiClient) {}
|
||||
|
||||
async getLeagueProtests(leagueId: string): Promise<any> {
|
||||
return this.apiClient.getLeagueProtests(leagueId);
|
||||
}
|
||||
|
||||
async getProtestById(leagueId: string, protestId: string): Promise<any> {
|
||||
return this.apiClient.getLeagueProtest(leagueId, protestId);
|
||||
}
|
||||
|
||||
async applyPenalty(input: ApplyPenaltyCommandDTO): Promise<void> {
|
||||
return this.apiClient.applyPenalty(input);
|
||||
}
|
||||
|
||||
async requestDefense(input: RequestProtestDefenseCommandDTO): Promise<void> {
|
||||
return this.apiClient.requestDefense(input);
|
||||
}
|
||||
|
||||
async reviewProtest(input: ReviewProtestCommandDTO): Promise<void> {
|
||||
return this.apiClient.reviewProtest(input);
|
||||
}
|
||||
|
||||
async findByRaceId(raceId: string): Promise<any> {
|
||||
return this.apiClient.getRaceProtests(raceId);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user