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

    Type Alias EntityDerivedCriteria

    The EntityDerivedCriteriaFields as concrete values, matching what entityCriteriaSql emits (is_set / is_not_set matchers can tell an absent key from a false, so the four below are never absent).

    identityId / organizationId are the exception, and optional here for the same reason they are branch-exclusive in the SQL: exactly one is ever present, and the other must be genuinely absent rather than undefined -valued. Read them through entityType — the pair is a discriminated union in everything but the type.

    type EntityDerivedCriteria = {
        countryCode: MatcherCriteria["countryCode"];
        customerId: string;
        entityType: NonNullable<MatcherCriteria["entityType"]>;
        hasIdentityDocument: boolean;
        identityId?: string;
        organizationId?: string;
        verificationByo: boolean;
    }
    Index
    countryCode: MatcherCriteria["countryCode"]
    customerId: string

    Always present — both SQL branches emit it, so it is not optional the way the two entity ids are.

    entityType: NonNullable<MatcherCriteria["entityType"]>
    hasIdentityDocument: boolean
    identityId?: string
    organizationId?: string
    verificationByo: boolean