api client refactor

This commit is contained in:
2025-12-17 18:01:47 +01:00
parent bab55955e1
commit 4177644b18
190 changed files with 6403 additions and 1624 deletions

View File

@@ -0,0 +1,41 @@
import { BaseApiClient } from '../base/BaseApiClient';
import type {
GetEntitySponsorshipPricingResultDto,
GetSponsorsOutputDto,
CreateSponsorInputDto,
CreateSponsorOutputDto,
SponsorDashboardDto,
SponsorSponsorshipsDto,
} from '../../dtos';
/**
* Sponsors API Client
*
* Handles all sponsor-related API operations.
*/
export class SponsorsApiClient extends BaseApiClient {
/** Get sponsorship pricing */
getPricing(): Promise<GetEntitySponsorshipPricingResultDto> {
return this.get<GetEntitySponsorshipPricingResultDto>('/sponsors/pricing');
}
/** Get all sponsors */
getAll(): Promise<GetSponsorsOutputDto> {
return this.get<GetSponsorsOutputDto>('/sponsors');
}
/** Create a new sponsor */
create(input: CreateSponsorInputDto): Promise<CreateSponsorOutputDto> {
return this.post<CreateSponsorOutputDto>('/sponsors', input);
}
/** Get sponsor dashboard */
getDashboard(sponsorId: string): Promise<SponsorDashboardDto | null> {
return this.get<SponsorDashboardDto | null>(`/sponsors/dashboard/${sponsorId}`);
}
/** Get sponsor sponsorships */
getSponsorships(sponsorId: string): Promise<SponsorSponsorshipsDto | null> {
return this.get<SponsorSponsorshipsDto | null>(`/sponsors/${sponsorId}/sponsorships`);
}
}