website refactor
This commit is contained in:
38
apps/website/lib/services/leagues/ProtestDetailService.ts
Normal file
38
apps/website/lib/services/leagues/ProtestDetailService.ts
Normal file
@@ -0,0 +1,38 @@
|
||||
import { Result } from '@/lib/contracts/Result';
|
||||
import { Service } from '@/lib/contracts/services/Service';
|
||||
import { ProtestDetailApiDto } from '@/lib/types/tbd/ProtestDetailApiDto';
|
||||
|
||||
export class ProtestDetailService implements Service {
|
||||
async getProtestDetail(leagueId: string, protestId: string): Promise<Result<ProtestDetailApiDto, never>> {
|
||||
// Mock data since backend not implemented
|
||||
const mockData: ProtestDetailApiDto = {
|
||||
id: protestId,
|
||||
leagueId,
|
||||
status: 'pending',
|
||||
submittedAt: new Date().toISOString(),
|
||||
incident: {
|
||||
lap: 5,
|
||||
description: 'Contact on corner 3, causing spin',
|
||||
},
|
||||
protestingDriver: {
|
||||
id: 'driver1',
|
||||
name: 'John Doe',
|
||||
},
|
||||
accusedDriver: {
|
||||
id: 'driver2',
|
||||
name: 'Jane Smith',
|
||||
},
|
||||
race: {
|
||||
id: 'race1',
|
||||
name: 'Race 1',
|
||||
scheduledAt: new Date().toISOString(),
|
||||
},
|
||||
penaltyTypes: [
|
||||
{ type: 'warning', label: 'Warning', description: 'Official warning' },
|
||||
{ type: 'time_penalty', label: 'Time Penalty', description: 'Add seconds to race time' },
|
||||
{ type: 'grid_penalty', label: 'Grid Penalty', description: 'Drop grid positions' },
|
||||
],
|
||||
};
|
||||
return Result.ok(mockData);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user