28 lines
1020 B
TypeScript
28 lines
1020 B
TypeScript
import { LeaguesApiClient } from '@/lib/api/leagues/LeaguesApiClient';
|
|
import { DriversApiClient } from '@/lib/api/drivers/DriversApiClient';
|
|
|
|
/**
|
|
* League Settings Service - DTO Only
|
|
*
|
|
* Returns raw API DTOs. No ViewModels or UX logic.
|
|
* All client-side presentation logic must be handled by hooks/components.
|
|
*/
|
|
export class LeagueSettingsService {
|
|
constructor(
|
|
private readonly leagueApiClient: LeaguesApiClient,
|
|
private readonly driverApiClient: DriversApiClient
|
|
) {}
|
|
|
|
async getLeagueSettings(leagueId: string): Promise<any> {
|
|
// This would typically call multiple endpoints to gather all settings data
|
|
// For now, return a basic structure
|
|
return {
|
|
league: await this.leagueApiClient.getAllWithCapacityAndScoring(),
|
|
config: { /* config data */ }
|
|
};
|
|
}
|
|
|
|
async transferOwnership(leagueId: string, currentOwnerId: string, newOwnerId: string): Promise<{ success: boolean }> {
|
|
return this.leagueApiClient.transferOwnership(leagueId, currentOwnerId, newOwnerId);
|
|
}
|
|
} |