import { Result } from '@/lib/contracts/Result';
import { Service, DomainError } from '@/lib/contracts/services/Service';
import { LeagueSponsorshipsApiDto } from '@/lib/types/tbd/LeagueSponsorshipsApiDto';

export class LeagueSponsorshipsService implements Service {
  async getSponsorshipsData(leagueId: string): Promise<Result<LeagueSponsorshipsApiDto, DomainError>> {
    // Mock data since backend not implemented
    const mockData: LeagueSponsorshipsApiDto = {
      leagueId,
      league: {
        id: leagueId,
        name: 'Mock League',
        description: 'A league with sponsorship opportunities',
      },
      sponsorshipSlots: [
        {
          id: 'slot-1',
          name: 'Main Sponsor',
          description: 'Primary sponsorship slot',
          price: 5000,
          currency: 'USD',
          isAvailable: false,
          sponsoredBy: {
            id: 'sponsor-1',
            name: 'Acme Racing',
            logoUrl: 'https://example.com/logo.png',
          },
        },
        {
          id: 'slot-2',
          name: 'Helmet Sponsor',
          description: 'Helmet branding sponsorship',
          price: 2000,
          currency: 'USD',
          isAvailable: true,
        },
        {
          id: 'slot-3',
          name: 'Car Sponsor',
          description: 'Car livery sponsorship',
          price: 3000,
          currency: 'USD',
          isAvailable: true,
        },
      ],
      sponsorshipRequests: [
        {
          id: 'request-1',
          slotId: 'slot-2',
          sponsorId: 'sponsor-2',
          sponsorName: 'SpeedWorks',
          requestedAt: '2024-10-01T10:00:00Z',
          status: 'pending',
        },
      ],
    };
    return Result.ok(mockData);
  }
}
