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

    Variable productActivationRuleEffectiveVersionViewConst

    productActivationRuleEffectiveVersionView: PgViewWithSelection<
        {
            existing: true;
            isAlias: false;
            name: "product_activation_rule_effective_version";
            schema: "b2b";
            selectedFields: {
                effectiveFrom: PgBuildColumn<
                    "product_activation_rule_effective_version",
                    SetNotNull<
                        PgCustomColumnBuilder<
                            { data: Instant; dataType: "custom"; driverParam: string },
                        >,
                    >,
                    {
                        data: Instant;
                        dataType: "custom";
                        driverParam: string;
                        enumValues: undefined;
                        generated: undefined;
                        hasDefault: false;
                        hasRuntimeDefault: false;
                        identity: undefined;
                        isAutoincrement: false;
                        isPrimaryKey: false;
                        name: string;
                        notNull: true;
                        tableName: "product_activation_rule_effective_version";
                    },
                >;
                id: PgBuildColumn<
                    "product_activation_rule_effective_version",
                    SetNotNull<PgIntegerBuilder>,
                    {
                        data: number;
                        dataType: "number int32";
                        driverParam: string | number;
                        enumValues: undefined;
                        generated: undefined;
                        hasDefault: false;
                        hasRuntimeDefault: false;
                        identity: undefined;
                        isAutoincrement: false;
                        isPrimaryKey: false;
                        name: string;
                        notNull: true;
                        tableName: "product_activation_rule_effective_version";
                    },
                >;
                matcher: PgBuildColumn<
                    "product_activation_rule_effective_version",
                    SetNotNull<Set$Type<PgJsonbBuilder, Matcher>>,
                    {
                        data: Matcher;
                        dataType: "object json";
                        driverParam: unknown;
                        enumValues: undefined;
                        generated: undefined;
                        hasDefault: false;
                        hasRuntimeDefault: false;
                        identity: undefined;
                        isAutoincrement: false;
                        isPrimaryKey: false;
                        name: string;
                        notNull: true;
                        tableName: "product_activation_rule_effective_version";
                    },
                >;
                priority: PgBuildColumn<
                    "product_activation_rule_effective_version",
                    SetNotNull<PgIntegerBuilder>,
                    {
                        data: number;
                        dataType: "number int32";
                        driverParam: string | number;
                        enumValues: undefined;
                        generated: undefined;
                        hasDefault: false;
                        hasRuntimeDefault: false;
                        identity: undefined;
                        isAutoincrement: false;
                        isPrimaryKey: false;
                        name: string;
                        notNull: true;
                        tableName: "product_activation_rule_effective_version";
                    },
                >;
                ruleId: PgBuildColumn<
                    "product_activation_rule_effective_version",
                    SetNotNull<PgIntegerBuilder>,
                    {
                        data: number;
                        dataType: "number int32";
                        driverParam: string | number;
                        enumValues: undefined;
                        generated: undefined;
                        hasDefault: false;
                        hasRuntimeDefault: false;
                        identity: undefined;
                        isAutoincrement: false;
                        isPrimaryKey: false;
                        name: string;
                        notNull: true;
                        tableName: "product_activation_rule_effective_version";
                    },
                >;
                value: PgBuildColumn<
                    "product_activation_rule_effective_version",
                    Set$Type<
                        SetNotNull<PgTextBuilder<[string, ...string[]]>>,
                        "APPROVE" | "DENY",
                    >,
                    {
                        data: "APPROVE" | "DENY";
                        dataType: "string";
                        driverParam: string;
                        enumValues: undefined;
                        generated: undefined;
                        hasDefault: false;
                        hasRuntimeDefault: false;
                        identity: undefined;
                        isAutoincrement: false;
                        isPrimaryKey: false;
                        name: string;
                        notNull: true;
                        tableName: "product_activation_rule_effective_version";
                    },
                >;
            };
        },
    > = ...

    The live product_activation_rule_version per rule: the newest whose effectiveFrom has passed, ties to the higher id, and no row when that one is DISABLED. SQL in 20261009500000_rule_effective_version_disabled_wins.sql.