import { apiClient } from './client'; import { PendingReferralRewardsResponse, FulfillReferralRewardResponse } from '@/types/referral'; export const referralApi = { // List users who reached the invite target and have not been granted the free month yet getPendingRewards: async (token: string): Promise => { return apiClient.get('/admin/referral-rewards', token); }, // Grant the free month to a user. product_id is optional: omit it to // auto-grant the meditation package's monthly product. fulfillReward: async ( userId: number, token: string, productId?: number ): Promise => { const data = productId ? { product_id: productId } : {}; return apiClient.post( `/admin/referral-rewards/${userId}/fulfill`, data, token ); } };