Kaizen
Browse modulesRulesrules/sharedTypes

Type Alias: Rule

type Rule = ZodObject<{
  condition_logic: ZodType<ConditionLogicNode, unknown, $ZodTypeInternals<ConditionLogicNode, unknown>>;
  created_at: ZodString;
  created_by: ZodString;
  description: ZodString;
  domain: ZodString;
  domain_config: ZodOptional<ZodRecord<ZodString, ZodUnknown>>;
  effective_end: ZodNullable<ZodString>;
  effective_start: ZodString;
  id: ZodString;
  identifier: ZodString;
  is_current: ZodBoolean;
  module: ZodString;
  name: ZodString;
  organization_id: ZodString;
  priority: ZodNumber;
  rule_effective_date: ZodNullable<ZodString>;
  rule_expiration_date: ZodNullable<ZodString>;
  scopes: ZodArray<ZodObject<{
     scope_type: ZodString;
     scope_value: ZodArray<ZodString>;
  }, $strip>>;
  status: ZodEnum<{
     active: "active";
     archived: "archived";
     inactive: "inactive";
  }>;
  updated_at: ZodString;
  version: ZodNumber;
}, $strip>;

Defined in: shared/rules/types/rules.ts:43

A rule row, with domain optionally narrowed by a consumer-supplied string literal union. Defaults to string so existing call sites keep their current typing; consumers opt into narrowing via Rule<MyDomain> (e.g. Rule<"pricing" | "eligibility">) for compile-time safety on the domain field. Runtime validation via the Rule Zod schema remains unchanged — it still accepts any string.