UNPKG

@accounter/server

Version:
47 lines (46 loc) 1.93 kB
import type { Transaction, Document, ChargeMatchProto, AggregatedTransaction, AggregatedDocument, ConfidenceScores } from '../types.js'; /** * Factory for creating mock transactions for testing */ export declare function createMockTransaction(overrides?: Partial<Transaction>): Transaction; /** * Factory for creating mock documents for testing */ export declare function createMockDocument(overrides?: Partial<Document>): Document; /** * Factory for creating mock aggregated transaction data */ export declare function createMockAggregatedTransaction(overrides?: Partial<AggregatedTransaction>): AggregatedTransaction; /** * Factory for creating mock aggregated document data */ export declare function createMockAggregatedDocument(overrides?: Partial<AggregatedDocument>): AggregatedDocument; /** * Factory for creating mock confidence scores */ export declare function createMockConfidenceScores(overrides?: Partial<ConfidenceScores>): ConfidenceScores; /** * Factory for creating mock charge matches */ export declare function createMockChargeMatch(overrides?: Partial<ChargeMatchProto>): ChargeMatchProto; /** * Helper to calculate expected overall confidence score * Formula: (amount × 0.4) + (currency × 0.2) + (business × 0.3) + (date × 0.1) */ export declare function calculateExpectedConfidence(scores: ConfidenceScores): number; /** * Helper to round confidence score to 2 decimal places */ export declare function roundConfidence(score: number): number; /** * Helper to validate a confidence score is within valid range */ export declare function isValidConfidenceScore(score: number): boolean; /** * Helper to check if a date is within N days of another date */ export declare function isWithinDays(date1: Date, date2: Date, days: number): boolean; /** * Helper to calculate days difference between two dates */ export declare function daysDifference(date1: Date, date2: Date): number;