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

    Root of the card hierarchy: the one girasol-card-search namespace the customer and admin surfaces share, and the bust seam every writer inherits. Both surfaces project the same row, so one cached shape serves both.

    Hierarchy (View Summary)

    Index
    cache: ServiceCache<CachedSearchPage<GirasolCardSearchItem>>
    db: B2bDatabase
    girasolClient: GirasolClient
    instance: (...args: []) => GirasolCardAdminService = ...

    The process service: the shared database, Valkey and Girasol.

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

    • Stores the status Girasol reports for every card on one card account, with a single getCardsByAccount call. A card Girasol does not list keeps its stored status and is returned in missing.

      Parameters

      • __namedParameters: { girasolAccountId: string }

      Returns Promise<
          | {
              ok: true;
              value: {
                  checked: number;
                  missing: string[];
                  updated: {
                      id: string;
                      previousStatus: | "ACTIVE"
                      | "DELETED"
                      | "BLOCKED"
                      | "REJECTED"
                      | "UNKNOWN"
                      | "CREATED"
                      | "REQUESTED"
                      | "EXPIRED"
                      | "FROZEN"
                      | "DELIVERED";
                      status: | "ACTIVE"
                      | "DELETED"
                      | "BLOCKED"
                      | "REJECTED"
                      | "UNKNOWN"
                      | "CREATED"
                      | "REQUESTED"
                      | "EXPIRED"
                      | "FROZEN"
                      | "DELIVERED";
                  }[];
              };
          }
          | {
              error: GirasolAccountError
              | ServiceError<"CARD_ACCOUNT_NOT_FOUND">;
              ok: false;
          },
      >

    • The search arguments get reads through. Every default is spelled out, so the same object is also search's cache key for that entry.

      Parameters

      • __namedParameters: { id: string }

      Returns { ids: string[]; page: number; pageSize: number }