41 lines
1.3 KiB
TypeScript
41 lines
1.3 KiB
TypeScript
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`);
|
|
}
|
|
} |