feat: merge the boot provider of categorize and matching forms

This commit is contained in:
Ahmed Bouhuolia
2024-06-29 17:00:36 +02:00
parent 5d5d4a1972
commit 3cd66ba4d6
10 changed files with 129 additions and 43 deletions

View File

@@ -13,6 +13,7 @@ import { FastField, FastFieldProps, Form, Formik } from 'formik';
import { useMatchTransaction } from '@/hooks/query/bank-rules';
import { MatchingTransactionFormValues } from './types';
import { transformToReq, useGetPendingAmountMatched } from './utils';
import { useCategorizeTransactionTabsBoot } from './CategorizeTransactionTabsBoot';
import {
WithBankingActionsProps,
withBankingActions,
@@ -23,7 +24,7 @@ const initialValues = {
};
export function MatchingBankTransaction() {
const uncategorizedTransactionId = 4;
const { uncategorizedTransactionId } = useCategorizeTransactionTabsBoot();
const { mutateAsync: matchTransaction } = useMatchTransaction();
// Handles the form submitting.
@@ -191,7 +192,6 @@ const MatchTransactionFooter = R.compose(withBankingActions)(
const handleCancelBtnClick = () => {
closeMatchingTransactionAside();
};
const totalPending = useGetPendingAmountMatched();
return (
@@ -202,7 +202,7 @@ const MatchTransactionFooter = R.compose(withBankingActions)(
Add Reconcile Transaction +
</AnchorButton>
<Text style={{ fontSize: 13 }} tagName='span'>
<Text style={{ fontSize: 13 }} tagName="span">
Pending <FormatNumber value={totalPending} currency={'USD'} />
</Text>
</Group>