frontend phase 15

This commit is contained in:
hamid
2026-07-10 20:28:06 +03:30
parent bc51cf59b4
commit 70cf00ce4a
151 changed files with 10711 additions and 44 deletions
@@ -0,0 +1,15 @@
import { useMutation } from '@tanstack/react-query';
import { payoutsApi } from '../apis';
import type { PayoutBatchPreview } from '../types';
/**
* The eligibility dry-run for a window — a **mutation**, not an auto-fetching query: it runs only when the
* admin explicitly asks to preview (never on mount), and its result (the eligible/skipped breakdown + the
* server's holiday-shifted processing date) is read from the mutation's `data`. The client renders it; it
* never computes eligibility or the shifted date.
*/
export function usePreviewPayoutBatch() {
return useMutation<PayoutBatchPreview, unknown, { periodStart: string; periodEnd: string }>({
mutationFn: ({ periodStart, periodEnd }) => payoutsApi.previewPayoutBatch(periodStart, periodEnd),
});
}