remove core from pages
This commit is contained in:
28
apps/website/lib/services/penalties/PenaltyService.ts
Normal file
28
apps/website/lib/services/penalties/PenaltyService.ts
Normal file
@@ -0,0 +1,28 @@
|
||||
import { PenaltiesApiClient } from '../../api/penalties/PenaltiesApiClient';
|
||||
|
||||
/**
|
||||
* Penalty Service
|
||||
*
|
||||
* Orchestrates penalty operations by coordinating API calls and view model creation.
|
||||
* All dependencies are injected via constructor.
|
||||
*/
|
||||
export class PenaltyService {
|
||||
constructor(
|
||||
private readonly apiClient: PenaltiesApiClient
|
||||
) {}
|
||||
|
||||
/**
|
||||
* Find penalties by race ID
|
||||
*/
|
||||
async findByRaceId(raceId: string): Promise<any[]> {
|
||||
const dto = await this.apiClient.getRacePenalties(raceId);
|
||||
return dto.penalties;
|
||||
}
|
||||
|
||||
/**
|
||||
* Apply a penalty
|
||||
*/
|
||||
async applyPenalty(input: any): Promise<void> {
|
||||
await this.apiClient.applyPenalty(input);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user