import { queryOptions } from '@tanstack/react-query' import { api } from '@/lib/api-client' import type { PaymentMethod } from '@/types/account' import type { PaginatedResponse, PaginationInput } from '@lunarfront/shared/schemas' export const paymentMethodKeys = { all: (accountId: string) => ['accounts', accountId, 'payment-methods'] as const, list: (accountId: string, params: PaginationInput) => [...paymentMethodKeys.all(accountId), params] as const, } export function paymentMethodListOptions(accountId: string, params: PaginationInput) { return queryOptions({ queryKey: paymentMethodKeys.list(accountId, params), queryFn: () => api.get>(`/v1/accounts/${accountId}/payment-methods`, params), }) } export const paymentMethodMutations = { create: (accountId: string, data: Record) => api.post(`/v1/accounts/${accountId}/payment-methods`, data), update: (id: string, data: Record) => api.patch(`/v1/payment-methods/${id}`, data), delete: (id: string) => api.del(`/v1/payment-methods/${id}`), }