import { BaseApiClient } from '../base/BaseApiClient'; import type { AllLeaguesWithCapacityDto, LeagueStatsDto, LeagueStandingsDto, LeagueScheduleDto, LeagueMembershipsDto, CreateLeagueInputDto, CreateLeagueOutputDto, } from '../../dtos'; /** * Leagues API Client * * Handles all league-related API operations. */ export class LeaguesApiClient extends BaseApiClient { /** Get all leagues with capacity information */ getAllWithCapacity(): Promise { return this.get('/leagues/all-with-capacity'); } /** Get total number of leagues */ getTotal(): Promise { return this.get('/leagues/total-leagues'); } /** Get league standings */ getStandings(leagueId: string): Promise { return this.get(`/leagues/${leagueId}/standings`); } /** Get league schedule */ getSchedule(leagueId: string): Promise { return this.get(`/leagues/${leagueId}/schedule`); } /** Get league memberships */ getMemberships(leagueId: string): Promise { return this.get(`/leagues/${leagueId}/memberships`); } /** Create a new league */ create(input: CreateLeagueInputDto): Promise { return this.post('/leagues', input); } /** Remove a member from league */ removeMember(leagueId: string, performerDriverId: string, targetDriverId: string): Promise<{ success: boolean }> { return this.patch<{ success: boolean }>(`/leagues/${leagueId}/members/${targetDriverId}/remove`, { performerDriverId }); } }