import { apiGet, apiPost } from '@/lib/http'
import type { ClaimDetailData } from '@/types/claim'

export function fetchClaimDetail(token: string) {
  return apiGet<ClaimDetailData>(`/api/v1/claim/${token}`)
}

export function submitClaimUid(token: string, uid: string) {
  return apiPost<ClaimDetailData>(`/api/v1/claim/${token}/uid`, { uid })
}

export function submitAffiliateDashClaim(
  token: string,
  payload: { gameAccount: string; bindUuid: string },
) {
  return apiPost<ClaimDetailData>(`/api/v1/claim/${token}/affiliate-dash/submit`, payload)
}

export function confirmKuaishouCloudClaimRole(token: string) {
  return apiPost<ClaimDetailData>(`/api/v1/claim/${token}/kuaishou-cloud/confirm-role`, {})
}

export function rebindKuaishouCloudClaimRole(token: string) {
  return apiPost<ClaimDetailData>(`/api/v1/claim/${token}/kuaishou-cloud/rebind-role`, {})
}

export function redeemKuaishouCloudClaim(token: string) {
  return apiPost<ClaimDetailData>(`/api/v1/claim/${token}/kuaishou-cloud/redeem`, {})
}
