Kaizen
Browse modulesInsightsinsights/sharedSchemas and constants

Variable: conditionLeafSchema

const conditionLeafSchema: ZodDiscriminatedUnion<[ZodObject<{
  field: ZodString;
  kind: ZodLiteral<"condition">;
  operator: ZodLiteral<"eq">;
  value: ZodUnion<readonly [ZodString, ZodNumber, ZodBoolean]>;
}, $strip>, ZodObject<{
  field: ZodString;
  kind: ZodLiteral<"condition">;
  operator: ZodLiteral<"neq">;
  value: ZodUnion<readonly [ZodString, ZodNumber, ZodBoolean]>;
}, $strip>, ZodObject<{
  field: ZodString;
  kind: ZodLiteral<"condition">;
  operator: ZodLiteral<"gt">;
  value: ZodUnion<readonly [ZodNumber, ZodString]>;
}, $strip>], "operator">;

Defined in: shared/insights/types/definition.ts:82

An inline, self-contained typed condition leaf. Unlike the rules engine's ConditionLogicNode (which references stored Conditions rows by id), an insights leaf carries its own field/operator/value so a definition is fully portable (builder, saved report, dashboard tile, and Ask all speak the same shape). Discriminated on operator so each operator pins the value shape it accepts.