@accounter/server
Version:
The test suite is split into three Vitest projects for efficiency and isolation:
39 lines (38 loc) • 1.66 kB
TypeScript
/**
* Charges Matcher Provider
*
* Provides database-integrated charge matching functionality using the Injector pattern.
* Integrates with existing modules: charges, transactions, and documents.
*/
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 {
/**
* Find potential matches for an unmatched charge
*
* @param chargeId - ID of the unmatched charge to find matches for
* @param injector - GraphQL modules injector for provider access
* @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, context: GraphQLModules.AppContext): 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.
*
* @param injector - GraphQL modules injector for provider access
* @param context - GraphQL context with user information
* @returns Summary of matches made, skipped charges, and errors
*/
autoMatchCharges(context: GraphQLModules.AppContext): Promise<AutoMatchChargesResult>;
}