@accounter/server
Version:
Accounter GraphQL server
46 lines (45 loc) • 2.1 kB
TypeScript
/**
* Charges Matcher Provider
*
* Provides database-integrated charge matching functionality using the Injector pattern.
* Integrates with existing modules: charges, transactions, and documents.
*/
import { AdminContextProvider } from '../../admin-context/providers/admin-context.provider.js';
import { ChargesProvider } from '../../charges/providers/charges.provider.js';
import { DocumentsProvider } from '../../documents/providers/documents.provider.js';
import { TransactionsProvider } from '../../transactions/providers/transactions.provider.js';
import { type AutoMatchChargesResult, type ChargeMatchesResult } from '../types.js';
/**
* Charges Matcher Provider
*
* Provides high-level charge matching operations with database integration.
* Uses the Injector pattern to access existing providers from other modules.
*/
export declare class ChargesMatcherProvider {
private adminContextProvider;
private chargesProvider;
private transactionsProvider;
private documentsProvider;
private context;
constructor(adminContextProvider: AdminContextProvider, chargesProvider: ChargesProvider, transactionsProvider: TransactionsProvider, documentsProvider: DocumentsProvider, context: GraphQLModules.ModuleContext);
/**
* Find potential matches for an unmatched charge
*
* @param chargeId - ID of the unmatched charge to find matches for
* @returns Top 5 matches ordered by confidence score
* @throws Error if charge not found
* @throws Error if charge is already matched
* @throws Error if charge data is invalid
*/
findMatchesForCharge(chargeId: string): Promise<ChargeMatchesResult>;
/**
* Auto-match all unmatched charges
*
* Automatically merges charges that have a single high-confidence match (≥0.95).
* Skips charges with multiple high-confidence matches (ambiguous).
* Processes all unmatched charges and returns a summary of actions taken.
*
* @returns Summary of matches made, skipped charges, and errors
*/
autoMatchCharges(): Promise<AutoMatchChargesResult>;
}