/**
 * React Query key factory for the payment domain (hierarchical, per the `services/{domain}` pattern).
 * Summary and outcome are keyed by the booking-request id (payment runs against the accepted request);
 * the invoice is keyed by the booking id it belongs to.
 */
export const paymentKeys = {
  all: ['payment'] as const,
  summaries: () => [...paymentKeys.all, 'summary'] as const,
  summary: (bookingRequestId: number) => [...paymentKeys.summaries(), bookingRequestId] as const,
  outcomes: () => [...paymentKeys.all, 'outcome'] as const,
  outcome: (bookingRequestId: number) => [...paymentKeys.outcomes(), bookingRequestId] as const,
  invoices: () => [...paymentKeys.all, 'invoice'] as const,
  invoice: (bookingId: number) => [...paymentKeys.invoices(), bookingId] as const,
};
