import { BaseApiClient } from '../base/BaseApiClient'; import type { GetPaymentsOutputDto, CreatePaymentInputDto, CreatePaymentOutputDto, GetMembershipFeesOutputDto, GetPrizesOutputDto, GetWalletOutputDto, ProcessWalletTransactionInputDto, ProcessWalletTransactionOutputDto, UpdateMemberPaymentInputDto, UpdateMemberPaymentOutputDto, GetWalletTransactionsOutputDto, } from '../../dtos'; /** * Payments API Client * * Handles all payment-related API operations. */ export class PaymentsApiClient extends BaseApiClient { /** Get payments */ getPayments(leagueId?: string, driverId?: string): Promise { const params = new URLSearchParams(); if (leagueId) params.append('leagueId', leagueId); if (driverId) params.append('driverId', driverId); const query = params.toString(); return this.get(`/payments${query ? `?${query}` : ''}`); } /** Create a payment */ createPayment(input: CreatePaymentInputDto): Promise { return this.post('/payments', input); } /** Get membership fees */ getMembershipFees(leagueId: string): Promise { return this.get(`/payments/membership-fees?leagueId=${leagueId}`); } /** Get prizes */ getPrizes(leagueId?: string, seasonId?: string): Promise { const params = new URLSearchParams(); if (leagueId) params.append('leagueId', leagueId); if (seasonId) params.append('seasonId', seasonId); const query = params.toString(); return this.get(`/payments/prizes${query ? `?${query}` : ''}`); } /** Get wallet */ getWallet(driverId: string): Promise { return this.get(`/payments/wallets?driverId=${driverId}`); } }