Add accounts UI with list, create, edit, detail tabs for all sub-entities

Accounts list with paginated table, search, sort. Account detail page with
tabs for members, payment methods, tax exemptions, and processor links.
All sub-entities have create/edit dialogs and delete actions. Forms use
shared Zod schemas via react-hook-form.
This commit is contained in:
Ryan Moon
2026-03-28 07:45:52 -05:00
parent e734ef4606
commit 9abdf6c050
23 changed files with 1688 additions and 6 deletions

View File

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