syncable-entity-builder-and-validation

Create validation logic and migration action builders for syncable entities in Twenty.

54.6k|8.4k|Updated Dec 1, 2022
One-click install
npx skills add https://github.com/twentyhq/twenty --skill syncable-entity-builder-and-validation-twentyhq
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: syncable-entity-builder-and-validation
Source: https://github.com/twentyhq/twenty/tree/main/.cursor/skills/syncable-entity-builder-and-validation
Command: npx skills add https://github.com/twentyhq/twenty --skill syncable-entity-builder-and-validation-twentyhq

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) components.

What problem does it solve?

This Skill streamlines the process of creating and validating business rules for syncable entities, ensuring data integrity and enabling smooth workspace migrations.

Core Features & Use Cases

  • Validation Logic: Implement checks for required fields, uniqueness, and foreign key constraints.
  • Migration Action Builders: Generate actions for creating, updating, and deleting entities.
  • Use Case: When creating a new 'customer' entity, ensure the 'email' field is unique and that any 'companyId' provided actually exists and is not deleted.

Quick Start

Use the syncable-entity-builder-and-validation skill to create validation logic and migration action builders for syncable entities.

Frequently Asked Questions about syncable-entity-builder-and-validation

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I add validation logic for syncable entities without throwing errors?

Validation logic for syncable entities uses validators designed to never throw errors or mutate data, returning error arrays instead. This approach ensures data integrity by capturing business rule violations safely during workspace operations.

How do I generate migration action builders for creating and updating entities?

Migration action builders generate actions for creating, updating, and deleting entities within the Twenty platform. They streamline workspace migration by producing the necessary actions to sync entity state changes reliably.

What is the best way to enforce uniqueness and foreign key checks during entity migration?

Enforcing uniqueness and foreign key checks during entity migration requires dedicated validation logic. Validators can verify that fields like email are unique and that foreign keys, such as companyId, exist and are not deleted before processing.

Does the Twenty platform support custom business rule validation for workspace migrations?

The Twenty platform supports custom business rule validation for workspace migrations through syncable entity builders. This enables developers to implement required field checks, uniqueness constraints, and referential integrity validations directly.

Why should validation logic return error arrays instead of throwing exceptions?

Returning error arrays instead of throwing exceptions prevents validation logic from mutating data or halting execution. This design allows all business rule violations to be collected and addressed systematically during entity synchronization.

Can I use entity builders to validate that a referenced foreign key is not deleted?

Entity builders support foreign key validation to ensure referenced records exist and are not deleted. This check maintains referential integrity when creating or updating syncable entities with relationships like companyId.