-
Notifications
You must be signed in to change notification settings - Fork 0
feat: Phase 5 ecosystem integration (5 features) #92
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -88,6 +88,14 @@ export function useUnclassifiedTransactions(limit = 50) { | |
| }); | ||
| } | ||
|
|
||
| export function useReconciledTransactions(limit = 50) { | ||
| const tenantId = useTenantId(); | ||
| return useQuery<UnclassifiedTransaction[]>({ | ||
| queryKey: ['/api/classification/reconciled', tenantId, limit], | ||
| enabled: !!tenantId, | ||
| }); | ||
|
Comment on lines
+91
to
+96
|
||
| } | ||
|
|
||
| export function useClassificationAudit(transactionId: string | null) { | ||
| return useQuery<ClassificationAuditEntry[]>({ | ||
| queryKey: ['/api/classification/audit', transactionId], | ||
|
|
@@ -191,3 +199,16 @@ export function useAiSuggest() { | |
| onSuccess: () => invalidateClassificationCache(qc), | ||
| }); | ||
| } | ||
|
|
||
| /** L3 — unlock a reconciled transaction */ | ||
| export function useUnreconcileTransaction() { | ||
| const qc = useQueryClient(); | ||
| return useMutation({ | ||
| mutationFn: (data: { transactionId: string }) => | ||
| apiRequest('POST', '/api/classification/unreconcile', data).then((r) => r.json()), | ||
| onSuccess: () => { | ||
| invalidateClassificationCache(qc); | ||
| qc.invalidateQueries({ queryKey: ['/api/classification/reconciled'] }); | ||
| }, | ||
| }); | ||
| } | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This hook takes a
limitargument but only stores it in the query key; the shared query function fetchesqueryKey[0]as the URL, so the request is always/api/classification/reconciledwithout?limit=. The backend then uses its default limit (50), so the reconciled tab can silently truncate results/counts when more than 50 rows exist. Include the limit in the URL itself.Useful? React with 👍 / 👎.