Kaizen
Browse modulesInsightsinsights/sharedSchemas and constants

Variable: dashboardFilterSchema

const dashboardFilterSchema: ZodDiscriminatedUnion<[ZodObject<{
  field: ZodString;
  id: ZodString;
  kind: ZodLiteral<"date-range">;
  label: ZodString;
}, $strip>, ZodObject<{
  field: ZodString;
  id: ZodString;
  kind: ZodLiteral<"select">;
  label: ZodString;
  multiple: ZodOptional<ZodBoolean>;
  searchable: ZodOptional<ZodBoolean>;
}, $strip>, ZodObject<{
  defaultOperator: ZodOptional<ZodEnum<{
     eq: "eq";
     gt: "gt";
     gte: "gte";
     lt: "lt";
     lte: "lte";
  }>>;
  field: ZodString;
  format: ZodOptional<ZodEnum<{
     currency: "currency";
     number: "number";
  }>>;
  id: ZodString;
  kind: ZodLiteral<"measure">;
  label: ZodString;
  operators: ZodOptional<ZodArray<ZodEnum<{
     eq: "eq";
     gt: "gt";
     gte: "gte";
     lt: "lt";
     lte: "lte";
  }>>>;
}, $strip>, ZodObject<{
  field: ZodString;
  id: ZodString;
  kind: ZodLiteral<"search">;
  label: ZodString;
}, $strip>], "kind">;

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

The available filter controls, discriminated on kind. Each targets one logical field and compiles to a single ConditionLeaf:

  • date-range — a from/to picker on a temporal field. between when both bounds are set, gte/lte for a half-open range.
  • select — a dimension (enum/string) picker. eq for a single choice, in when multiple. Its choices are resolved from the data server-side (see DashboardFilterOption), not authored on the descriptor.
  • measure — a numeric comparison (= > < ≥ ≤) on a number/money field. operators narrows the offered set; defaultOperator preselects one.
  • search — a contains text match on a string field.