remove core from pages

This commit is contained in:
2025-12-18 19:14:50 +01:00
parent 9814d9682c
commit 4a3087ae35
35 changed files with 552 additions and 354 deletions

View File

@@ -50,4 +50,9 @@ export class DriversApiClient extends BaseApiClient {
getDriverProfile(driverId: string): Promise<DriverProfileDTO> {
return this.get<DriverProfileDTO>(`/drivers/${driverId}/profile`);
}
/** Update current driver profile */
updateProfile(updates: { bio?: string; country?: string }): Promise<DriverDTO> {
return this.put<DriverDTO>('/drivers/profile', updates);
}
}

View File

@@ -50,6 +50,11 @@ export class LeaguesApiClient extends BaseApiClient {
return this.patch<{ success: boolean }>(`/leagues/${leagueId}/members/${targetDriverId}/remove`, { performerDriverId });
}
/** Update a member's role in league */
updateMemberRole(leagueId: string, performerDriverId: string, targetDriverId: string, newRole: string): Promise<{ success: boolean }> {
return this.patch<{ success: boolean }>(`/leagues/${leagueId}/members/${targetDriverId}/role`, { performerDriverId, newRole });
}
/** Get league seasons */
getSeasons(leagueId: string): Promise<{ seasons: Array<{ id: string; status: string }> }> {
return this.get<{ seasons: Array<{ id: string; status: string }> }>(`/leagues/${leagueId}/seasons`);
@@ -77,4 +82,9 @@ export class LeaguesApiClient extends BaseApiClient {
newOwnerId,
});
}
/** Get races for a league */
getRaces(leagueId: string): Promise<{ races: any[] }> {
return this.get<{ races: any[] }>(`/leagues/${leagueId}/races`);
}
}

View File

@@ -0,0 +1,18 @@
import { BaseApiClient } from '../base/BaseApiClient';
/**
* Penalties API Client
*
* Handles all penalty-related API operations.
*/
export class PenaltiesApiClient extends BaseApiClient {
/** Get penalties for a race */
getRacePenalties(raceId: string): Promise<{ penalties: any[] }> {
return this.get<{ penalties: any[] }>(`/races/${raceId}/penalties`);
}
/** Apply a penalty */
applyPenalty(input: any): Promise<void> {
return this.post<void>('/races/penalties/apply', input);
}
}

View File

@@ -30,4 +30,14 @@ export class ProtestsApiClient extends BaseApiClient {
requestDefense(input: RequestProtestDefenseCommandDTO): Promise<void> {
return this.post<void>('/races/protests/defense/request', input);
}
/** Review protest */
reviewProtest(input: { protestId: string; stewardId: string; decision: string; decisionNotes: string }): Promise<void> {
return this.post<void>(`/protests/${input.protestId}/review`, input);
}
/** Get protests for a race */
getRaceProtests(raceId: string): Promise<{ protests: any[] }> {
return this.get<{ protests: any[] }>(`/races/${raceId}/protests`);
}
}

View File

@@ -44,4 +44,19 @@ export class SponsorsApiClient extends BaseApiClient {
getSponsor(sponsorId: string): Promise<SponsorDTO | null> {
return this.get<SponsorDTO | null>(`/sponsors/${sponsorId}`);
}
/** Get pending sponsorship requests for an entity */
getPendingSponsorshipRequests(params: { entityType: string; entityId: string }): Promise<{ requests: any[] }> {
return this.get<{ requests: any[] }>(`/sponsors/requests?entityType=${params.entityType}&entityId=${params.entityId}`);
}
/** Accept a sponsorship request */
acceptSponsorshipRequest(requestId: string, respondedBy: string): Promise<void> {
return this.post(`/sponsors/requests/${requestId}/accept`, { respondedBy });
}
/** Reject a sponsorship request */
rejectSponsorshipRequest(requestId: string, respondedBy: string, reason?: string): Promise<void> {
return this.post(`/sponsors/requests/${requestId}/reject`, { respondedBy, reason });
}
}