import type { AcceptSponsorshipRequestInputDTO } from '../../../types/generated/AcceptSponsorshipRequestInputDTO'; import type { CreateSponsorInputDTO } from '../../../types/generated/CreateSponsorInputDTO'; import type { GetPendingSponsorshipRequestsOutputDTO } from '../../../types/generated/GetPendingSponsorshipRequestsOutputDTO'; import type { GetSponsorOutputDTO } from '../../../types/generated/GetSponsorOutputDTO'; import type { RejectSponsorshipRequestInputDTO } from '../../../types/generated/RejectSponsorshipRequestInputDTO'; import type { SponsorDashboardDTO } from '../../../types/generated/SponsorDashboardDTO'; import type { SponsorDTO } from '../../../types/generated/SponsorDTO'; import type { SponsorSponsorshipsDTO } from '../../../types/generated/SponsorSponsorshipsDTO'; import { BaseApiClient } from '../base/BaseApiClient'; // Types that are not yet generated export type CreateSponsorOutputDto = { id: string; name: string }; export type GetEntitySponsorshipPricingResultDto = { pricing: Array<{ entityType: string; price: number }> }; export type GetSponsorsOutputDto = { sponsors: SponsorDTO[] }; /** * Sponsors API Client * * Handles all sponsor-related API operations. */ export class SponsorsApiClient extends BaseApiClient { /** Get sponsorship pricing */ getPricing(): Promise { return this.get('/sponsors/pricing'); } /** Get all sponsors */ getAll(): Promise { return this.get('/sponsors'); } /** Create a new sponsor */ create(input: CreateSponsorInputDTO): Promise { return this.post('/sponsors', input); } /** Get sponsor dashboard */ getDashboard(sponsorId: string): Promise { return this.get(`/sponsors/dashboard/${sponsorId}`); } /** Get sponsor sponsorships */ getSponsorships(sponsorId: string): Promise { return this.get(`/sponsors/${sponsorId}/sponsorships`); } /** Get sponsor by ID */ getSponsor(sponsorId: string): Promise { return this.get(`/sponsors/${sponsorId}`); } /** Get pending sponsorship requests for an entity */ getPendingSponsorshipRequests(params: { entityType: string; entityId: string }): Promise { return this.get(`/sponsors/requests?entityType=${params.entityType}&entityId=${params.entityId}`); } /** Accept a sponsorship request */ acceptSponsorshipRequest(requestId: string, input: AcceptSponsorshipRequestInputDTO): Promise { return this.post(`/sponsors/requests/${requestId}/accept`, input); } /** Reject a sponsorship request */ rejectSponsorshipRequest(requestId: string, input: RejectSponsorshipRequestInputDTO): Promise { return this.post(`/sponsors/requests/${requestId}/reject`, input); } /** Get sponsor billing information */ getBilling(sponsorId: string): Promise<{ // eslint-disable-next-line @typescript-eslint/no-explicit-any paymentMethods: any[]; // eslint-disable-next-line @typescript-eslint/no-explicit-any invoices: any[]; // eslint-disable-next-line @typescript-eslint/no-explicit-any stats: any; }> { return this.get(`/sponsors/billing/${sponsorId}`); } /** Get available leagues for sponsorship */ // eslint-disable-next-line @typescript-eslint/no-explicit-any getAvailableLeagues(): Promise { return this.get('/sponsors/leagues/available'); } /** Get detailed league information */ getLeagueDetail(leagueId: string): Promise<{ // eslint-disable-next-line @typescript-eslint/no-explicit-any league: any; // eslint-disable-next-line @typescript-eslint/no-explicit-any drivers: any[]; // eslint-disable-next-line @typescript-eslint/no-explicit-any races: any[]; }> { return this.get(`/sponsors/leagues/${leagueId}/detail`); } /** Get sponsor settings */ getSettings(sponsorId: string): Promise<{ // eslint-disable-next-line @typescript-eslint/no-explicit-any profile: any; // eslint-disable-next-line @typescript-eslint/no-explicit-any notifications: any; // eslint-disable-next-line @typescript-eslint/no-explicit-any privacy: any; }> { return this.get(`/sponsors/settings/${sponsorId}`); } /** Update sponsor settings */ // eslint-disable-next-line @typescript-eslint/no-explicit-any updateSettings(sponsorId: string, input: any): Promise { return this.put(`/sponsors/settings/${sponsorId}`, input); } }