@cfxlabsinc/b2b-services
    Preparing search index...
    MissingBankTransactionFetcher: (
        args: {
            account: ResolvedAccount;
            bankId: BankId;
            parsed: WireEmailParsed;
            wireNumber: string;
        },
    ) => Promise<{ bankTransactionId: string } | null>

    Pulls the bank_transaction for a wire the feed has not delivered yet, and inserts it.

    The escape hatch for the ordering that the enrichment path cannot serve. For fib the bank emails within minutes of the wire landing while the metcap HTTP feed is a scheduled sync, so the row enrichWireEmail looks for very often does not exist at the moment the email arrives. Rather than record the wire as UNMATCHED and wait for a sync that may be an hour away — during which the customer's deposit simply has not happened — this asks the metcap API for that account's transactions directly and writes the row the sync would have written.

    Supplied by the caller rather than imported, because the implementation lives in @cfxlabsinc/metcap-services and that package already depends on this one. A direct import would cycle; a callback keeps the edge one-directional and keeps every fib-specific detail (credentials, paging, the transaction shape) on the metcap side.

    Returns the created bank transaction's id, or null when the API does not have the wire either — which is a real answer, not an error: the metcap feed lags the email often enough that "not there yet" is expected, and the scheduled sync's own backfillWireEmailForBankTransaction is the second chance.

    Type Declaration

      • (
            args: {
                account: ResolvedAccount;
                bankId: BankId;
                parsed: WireEmailParsed;
                wireNumber: string;
            },
        ): Promise<{ bankTransactionId: string } | null>
      • Parameters

        • args: {
              account: ResolvedAccount;
              bankId: BankId;
              parsed: WireEmailParsed;
              wireNumber: string;
          }

        Returns Promise<{ bankTransactionId: string } | null>