Kaizen
Browse modulesInsightsinsights/sharedSchemas and constants

Variable: dashboardFilterValueSchema

const dashboardFilterValueSchema: ZodDiscriminatedUnion<[ZodObject<{
  from: ZodString;
  kind: ZodLiteral<"date-range">;
  to: ZodNullable<ZodString>;
}, $strip>, ZodObject<{
  kind: ZodLiteral<"select">;
  values: ZodArray<ZodString>;
}, $strip>, ZodObject<{
  kind: ZodLiteral<"measure">;
  operator: ZodEnum<{
     eq: "eq";
     gt: "gt";
     gte: "gte";
     lt: "lt";
     lte: "lte";
  }>;
  value: ZodNumber;
}, $strip>, ZodObject<{
  kind: ZodLiteral<"search">;
  text: ZodString;
}, $strip>], "kind">;

Defined in: shared/insights/types/dashboard-filter.ts:151

A viewer's live selection for one filter, tagged with the same kind as its descriptor so the map round-trips through Zod (a consumer persists it, or it arrives as client input on a tile run). An empty/cleared selection is represented by the ABSENCE of the entry, not a sentinel value — see DashboardFilterValues.

to is nullable because the range picker reports a null upper bound while the user is mid-selection; the compiler treats that as a half-open range.