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

    Root of the customer class hierarchy: owns the one customer-search cache and the seam that busts it.

    Customer has a single read surface — CustomerService has always served both consumer and admin callers — so there is one keyPrefix, "customer".

    Hierarchy (View Summary)

    Index
    cache: ServiceCache<CachedSearchPage<Customer>>
    • Drop this customer's cached reads.

      Lives here rather than on the writer because it's the cache's own concern — it names the folded-get keys and the membership tag — so both the reader (CustomerQueryService) and the writer (CustomerService) inherit it. The actual caller is customerOnboardingActivities (@cfxlabsinc/onboarding-services), which calls this once a primary organization exists for the customer: a customer is invisible to get/search until its primary org exists, so every read taken earlier in onboarding cached a negative entry with a 24h L2 TTL, and this is what clears it.

      Parameters

      • __namedParameters: { id: string }

      Returns Promise<void>

    • 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>

    • 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 exact cache key CustomerQueryService.get({ id }) reads through.

      get folds onto search, so its entry is an ordinary single-row search page — these args must stay identical to the ones get passes ({ ids: [id], pageSize: 1 }, plus search's page default of 1). Every other filter is undefined there, and serviceCacheKey canonicalizes with JCS, which drops undefined properties, so naming only the three that are set produces the same digest. customerCache.test.ts pins the equivalence.

      Returns the key arguments; the cache hashes and surface-prefixes them. Never pre-hash at a call site.

      Parameters

      • __namedParameters: { id: string }

      Returns Record<string, unknown>