@cfxlabsinc/b2b-services
    Preparing search index...
    OrgWithCustomer: Organization & {
        customerId: string;
        customerName: string;
        isMainOrg?: boolean;
    }

    A search row: the organization plus its resolved owning customer.

    Both surfaces project exactly this shape, which is what lets them share one cache namespace and one cached value type. The consumer search knows customerId from its own required argument and was already inner-joining b2b.customer — it now selects from that join rather than discarding it.

    Type Declaration

    • customerId: string
    • customerName: string
    • OptionalisMainOrg?: boolean

      Admin-only projection of the onboarding-internal main-org flag, used to gate the admin org-detail delete action (never deletable — ~20 transaction views resolve through it). Optional and deliberately absent from the base Organization type: the consumer mapper (OrganizationQueryService's mapOrganizationFromDb) never sets it, so it's never present on a consumer-surface row and can't leak through mapToApiOrganization's field spread into the public org-api response. Only OrganizationAdminService's mapper populates it.