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