feat: Calculate the total pending when matching.

This commit is contained in:
Ahmed Bouhuolia
2024-06-29 14:35:24 +02:00
parent b01528c06b
commit 5d5d4a1972
3 changed files with 38 additions and 8 deletions

View File

@@ -1,5 +1,6 @@
import { useMatchingTransactions } from '@/hooks/query/bank-rules';
import { defaultTo } from 'lodash';
import React, { createContext } from 'react';
import { useMatchingTransactions } from '@/hooks/query/bank-rules';
interface MatchingTransactionBootValues {
isMatchingTransactionsLoading: boolean;
@@ -29,9 +30,9 @@ function MatchingTransactionBoot({
const provider = {
isMatchingTransactionsLoading,
possibleMatches: matchingTransactions?.possibleMatches,
perfectMatchesCount: 2,
perfectMatches: matchingTransactions?.perfectMatches,
possibleMatches: defaultTo(matchingTransactions?.possibleMatches, []),
perfectMatchesCount: matchingTransactions?.perfectMatches?.length || 0,
perfectMatches: defaultTo(matchingTransactions?.perfectMatches, []),
} as MatchingTransactionBootValues;
return <RuleFormBootContext.Provider value={provider} {...props} />;