UNPKG

@accounter/server

Version:
24 lines (23 loc) 1.13 kB
import { CommentaryProto } from '../types.js'; import { DecoratedLedgerRecord } from './profit-and-loss.helper.js'; type EntityAmountAccumulator = { amount: number; ledgerRecords: Map<string, DecoratedLedgerRecord>; }; type AmountsBySortCode = Map<number, { amount: number; records: Map<string, EntityAmountAccumulator>; }>; export declare function updateRecords(amountsByEntity: AmountsBySortCode, amount: number, sortCode: number, financialEntityId: string, ledgerRecord: DecoratedLedgerRecord): void; export type FilteringRule = (financialEntityId: string, sortCode: number) => boolean; export type FilteringOptions = { rule: FilteringRule; negate?: boolean; }; export declare function amountByFinancialEntityIdAndSortCodeValidations<T extends FilteringOptions[], R extends { [K in keyof T]: number; }>(unfilteredRecords: DecoratedLedgerRecord[], filteringRules: T): R; export declare function recordsByFinancialEntityIdAndSortCodeValidations<T extends FilteringOptions[], R extends { [K in keyof T]: CommentaryProto; }>(unfilteredRecords: DecoratedLedgerRecord[], filteringRules: T): R; export {};