@cfxlabsinc/b2b-services
    Preparing search index...
    LedgerAccountSearchItem: LedgerAccount & {
        customerId: Customer["id"];
        customerName: string;
        customerOrganizationId: string;
        entityCountry: string;
        entityDisplayName: string;
        entityId: Entity["id"];
        entityReferenceId: string | null;
        entityType: Entity["type"];
        rawName: string | null;
    }

    A search row: the ledger account plus its resolved customer and entity.

    Both surfaces project exactly this shape, which is what lets them share one cache namespace and one cached value type. They already ran the identical join structure (customer inner, identity / organization left) — the union is just the columns each one previously discarded:

    • the consumer search gains customerId / customerName,
    • the admin search gains rawName / entityCountry.

    rawName is the stored name column before the null-fallback placeholder mapLedgerAccountFromDb substitutes (Account • • • • 1234) — it is not a redaction, so carrying it on both surfaces discloses nothing new. The admin surface already saw the same value through name whenever it was non-null.

    Type Declaration

    • customerId: Customer["id"]
    • customerName: string
    • customerOrganizationId: string
    • entityCountry: string
    • entityDisplayName: string
    • entityId: Entity["id"]
    • entityReferenceId: string | null
    • entityType: Entity["type"]
    • rawName: string | null

      The stored account name before the display fallback — null when unnamed.