@accounter/server
Version:
Accounter GraphQL server
36 lines (35 loc) • 2.15 kB
TypeScript
import DataLoader from 'dataloader';
import { TenantAwareDBClient } from '../../app-providers/tenant-db-client.js';
import { FinancialAccountsProvider } from '../../financial-accounts/providers/financial-accounts.provider.js';
import { FinancialBankAccountsProvider } from '../../financial-accounts/providers/financial-bank-accounts.provider.js';
import { TransactionsProvider } from '../../transactions/providers/transactions.provider.js';
import type { ChargeSecurityProto } from '../types.js';
export declare class ForeignSecuritiesProvider {
private db;
private transactionsProvider;
private financialAccountsProvider;
private financialBankAccountsProvider;
constructor(db: TenantAwareDBClient, transactionsProvider: TransactionsProvider, financialAccountsProvider: FinancialAccountsProvider, financialBankAccountsProvider: FinancialBankAccountsProvider);
private batchSecuritiesByKeys;
securityByKeyLoader: DataLoader<string, import("../types.js").IGetSecuritiesByKeysResult | null, string>;
/**
* The Poalim identity (bank/branch/account) of each account the given transactions touch.
* `financial_accounts.account_number` is text while the poalim_* tables store it as an
* integer, so non-numeric account numbers (and non-bank accounts, which have no
* financial_bank_accounts row) simply drop out — they can never match an execution.
*/
private getAccountTuples;
/**
* Ingested portfolio executions matched to the charge's transactions, grouped by security
* key. Returns an empty map when the charge touches no resolvable Poalim account, so a
* charge whose accounts predate the bank-account backfill degrades to "no activity" rather
* than erroring.
*/
private getMatchedExecutions;
/**
* The securities a charge's transactions reference, keyed off the security key each
* description carries. Keys with no ingested row are still returned, with a null
* `details`, so a stale or missing scrape is visible instead of silently dropping data.
*/
getChargeSecurities(chargeId: string): Promise<ChargeSecurityProto[]>;
}