syncable-entity-builder-and-validation
Syncable Entity: Builder & Validation (Step 3/6)
Purpose: Implement business rule validation and create migration action builders.
When to use: After completing Steps 1-2 (Types, Cache, Transform). Required before implementing action handlers.
Quick Start
This step creates:
- Validator service (business logic validation)
- Builder service (action creation)
- Orchestrator wiring (CRITICAL - often forgotten!)
Key principles:
- Validators never throw - return error arrays
- Validators never mutate - pass optimistic entity maps
- Use indexed lookups (O(1)) not
Object.values().find()(O(n))
More from twentyhq/twenty
syncable-entity-cache-and-transform
Create cache services and transformation utilities for syncable entities in Twenty. Use when implementing entity-to-flat conversions, input DTO transpilation to universal flat entities, or cache recomputation for syncable entities.
39syncable-entity-testing
Create comprehensive integration tests for syncable entities in Twenty. Use when writing integration tests for metadata entities, covering validator exceptions, input transpilation errors, and CRUD operations. Tests are MANDATORY for all syncable entities.
38syncable-entity-types-and-constants
Define types, entities, and central constant registrations for syncable entities in Twenty's workspace migration system. Use when creating new syncable entities, defining TypeORM entities, flat entity types, or registering in central constants (ALL_ENTITY_PROPERTIES_CONFIGURATION_BY_METADATA_NAME, ALL_ONE_TO_MANY_METADATA_RELATIONS, ALL_MANY_TO_ONE_METADATA_FOREIGN_KEY, ALL_MANY_TO_ONE_METADATA_RELATIONS).
38syncable-entity-runner-and-actions
Implement action handlers for executing workspace migrations in Twenty. Use when creating database operations for syncable entities, implementing universal-to-flat entity transpilation, or handling create/update/delete actions in the runner layer.
38syncable-entity-integration
Wire syncable entity services into NestJS modules, create service layer and resolvers for Twenty entities. Use when registering builders, validators, and action handlers in modules, creating business services, or exposing entities via GraphQL API with proper exception handling.
37