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

    Owns deposit-search. DepositAdminService is the only deposit writer; a deposit row embeds its quote, so quote writers bust it through DepositQuoteCache.

    Hierarchy (View Summary)

    Index
    cache: ServiceCache<CachedSearchPage<Deposit>>
    db: B2bDatabase
    instance: (...args: []) => DepositAdminQueryService = ...

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

    • Every deposit on an ACH batch with its status, read from the database. Batch reconciliation rewrites the credit's DEPOSIT_IDS from these, so a cached status would put back a deposit that has cancelled.

      Parameters

      • __namedParameters: { achBatchId: string }

      Returns Promise<{ ok: true; value: Pick<Deposit, "id" | "status">[] }>

    • The fee transfer a deposit already recorded and when the row last changed, read from the database, or null without the deposit. The mint reads it so a retry records its fee once.

      Parameters

      • __namedParameters: { id: string }

      Returns Promise<{ ok: true; value: Pick<Deposit, "updatedAt" | "feeSweepTxId"> | null }>

    • The deposit while it is still in one of statuses, read from the database. For a guard that acts on that status, where a stale cached status would let it act on a deposit that has since settled or cancelled.

      Parameters

      • __namedParameters: {
            id: string;
            statuses: (
                "PENDING"
                | "CANCELLED"
                | "PROCESSING"
                | "COMPLETED"
                | "RETURNED"
            )[];
        }

      Returns Promise<{ ok: true; value: Deposit | null }>

    • Get a deposit by ID without customer restriction

      Parameters

      • __namedParameters: {
            id: string;
            includeHistory?: boolean;
            tx?: PgAsyncTransaction<NodePgQueryResultHKT, EmptyRelations>;
        }

      Returns Promise<{ ok: true; value: Deposit | null }>

    • Clear each customer's membership tag and each record tag wherever cached, and always this namespace's collection tag. keys are exact deletes in this instance's key space: the only bust a null client honours.

      Parameters

      • __namedParameters: {
            customerIds: readonly string[];
            keys?: readonly CacheKey[];
            records?: readonly string[];
        }

      Returns Promise<void>

    • Admin search for deposits without customer restriction

      Parameters

      • __namedParameters: DepositAdminSearchArgs

      Returns Promise<{ ok: true; value: DepositAdminSearchPage }>

    • Tags for a page: the scope its query searched (each customer's membership tag, else the collection tag), so an empty page is bustable too, plus the records it projects and the fields that chose or ordered its rows.

      Parameters

      • __namedParameters: {
            customerIds: readonly string[] | undefined;
            fields?: readonly string[];
            records?: readonly string[];
        }

      Returns string[]

    • The key get reads through on the admin surface: { ids: [id], includeHistory, pageSize: 1 } plus search's page default. Writers pass both includeHistory variants so read-after-write holds under a null client.

      Parameters

      • __namedParameters: { id: string }

      Returns CacheKey[]