import { Result } from '@/lib/contracts/Result';
import { Service, DomainError } 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, DomainError>> {
    // 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);
  }
}
