@cfxlabsinc/b2b-services
    Preparing search index...

    Record-tag buster + realtime broadcaster over the transaction projection owned by TransactionQueryService. Transaction-writer services (deposit, manual mint, withdrawal, swap, ledger-account transfer, card, reward, redemption, fee, escrow) construct or receive one of these and call invalidateTag after a successful write + event publish, so that — cross-process via the shared Valkey cluster and the internal event bus — both:

    1. every cached page listing the customer's transactions, every admin entry pinned to a written transaction, and the admin collection are cleared, and
    2. the dashboard's open clients are nudged to refetch the affected rows.

    The nudge is transaction.transaction.updated, which the appsync relay fans out on AppSync Events. It carries ids only, so writers never need db / TransactionQueryService to re-serialize a row.

    Transactions are the one entity that keeps a buster collaborator rather than rooting every writer on a SearchCache subclass: the writers are deposit / withdrawal / swap / reward / card / … services, each already rooted in its own entity's hierarchy and in another package, so single inheritance forbids them extending a TransactionCache too. See CACHING.md "Cross-domain (foreign-key) writers".

    Index
    • Parameters

      • __namedParameters: {
            internalEventPublisher: InternalEventPublisher | null;
            valkeyClient: ValkeyClient | null;
        }
        • internalEventPublisher: InternalEventPublisher | null

          Publishes transaction.transaction.updated, which is how dashboards hear of a change. null disables realtime (tests); the bust still runs. Required so every construction site decides.

        • valkeyClient: ValkeyClient | null

      Returns TransactionCacheBuster

    instance: (...args: []) => TransactionCacheBuster = ...

    The process default: built from each dependency's own instance().

    • The bust for a write that touched several customers' rows (a transfer's two legs, a batch): ONE bust over every change's tags, then one realtime publish per change.

      The bust runs first, so the dashboard refetches fresh data, and never throws for a Valkey failure. The publish is best-effort too: an internal-bus failure can never fail the mutation that triggered it.

      Parameters

      Returns Promise<void>