Files
gridpilot.gg/apps/website/lib/services/leagues/LeagueRulebookService.ts
2026-01-14 13:27:26 +01:00

30 lines
1.0 KiB
TypeScript

import { Result } from '@/lib/contracts/Result';
import { Service } from '@/lib/contracts/services/Service';
import { RulebookApiDto } from '@/lib/types/tbd/RulebookApiDto';
export class LeagueRulebookService implements Service {
async getRulebookData(leagueId: string): Promise<Result<RulebookApiDto, never>> {
// Mock data since backend not implemented
const mockData: RulebookApiDto = {
leagueId,
scoringConfig: {
gameName: 'iRacing',
scoringPresetName: 'Custom Rules',
championships: [
{
type: 'driver',
sessionTypes: ['Race'],
pointsPreview: [
{ sessionType: 'Race', position: 1, points: 25 },
{ sessionType: 'Race', position: 2, points: 20 },
{ sessionType: 'Race', position: 3, points: 16 },
],
bonusSummary: ['Pole Position: +1', 'Fastest Lap: +1'],
}
],
dropPolicySummary: 'All results count',
},
};
return Result.ok(mockData);
}
}