Skip to content

chore(fe): migrate frontend filter types to shared zod schemas#5687

Draft
andrewwallacespeckle wants to merge 5 commits intomainfrom
andrew/zod-filter-types
Draft

chore(fe): migrate frontend filter types to shared zod schemas#5687
andrewwallacespeckle wants to merge 5 commits intomainfrom
andrew/zod-filter-types

Conversation

@andrewwallacespeckle
Copy link
Copy Markdown
Contributor

@andrewwallacespeckle andrewwallacespeckle commented Oct 7, 2025

Ensures type safety between frontend and backend for viewer filtering system.

Shared package:

  • Added Zod schemas for all filter condition types (NumericFilterCondition, StringFilterCondition, BooleanFilterCondition, ExistenceFilterCondition)
  • Added runtime value objects (*Values) for use with Object.values()
  • Export validation helpers: parseSerializedFilters(), parseQueryCriteria()
  • Export discriminated union type SerializedFilterData for type-safe filter serialization

Frontend:

  • Replaced local enum definitions with imports from @speckle/shared/viewer/filters
  • Maintained backward compatibility via const objects that support dot notation (e.g., NumericFilterCondition.IsBetween)
  • Updated getConditionsForType() to use new *Values objects

@andrewwallacespeckle andrewwallacespeckle changed the title feat(fe): shared filter types using zod chore(fe): migrate frontend filter types to shared zod schemas Oct 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant