import { useQuery } from '@tanstack/react-query';
import { refundsApi } from '../apis';
import { refundKeys } from '../keys';
import { REFUND_STATUS_STALE_TIME } from '../constants';

/** Every refund the customer owns (wallet «استردادها» tab, REQ-048) — newest first. */
export function useMyRefunds() {
  return useQuery({
    queryKey: refundKeys.mine(),
    queryFn: () => refundsApi.getMyRefunds(),
    staleTime: REFUND_STATUS_STALE_TIME,
  });
}
