feat: Custom fields — JSONB with schema per entity (PRD §5.5)
Models: CustomFieldDef (schema definitions) + CustomFieldValue (entity values) - Per entity type: company, person, deal, project, invoice, ticket, contract - Field types: string, number, boolean, date, select, multiselect - Options for select/multiselect stored as JSON - Unique constraint: (entityType, key) for definitions, (entityType, entityId, fieldDefId) for values API /api/aos/custom-fields: - GET: list all definitions (+ filter by entityType) - POST: create definition (Zod validated, lowercase_snake_case key, unique check) - PATCH: set value on entity (upsert pattern) Seed: 10 field definitions across 6 entity types - company: branche, mitarbeiterzahl, umsatzklasse - person: entscheider, kontaktweg - deal: wettbewerber, entscheidungsgrund - project: prioritaet - invoice: kostenstelle - ticket: auswirkung Verified: 10 defs, 3 company fields, duplicate→409, invalid key→400
This commit is contained in:
1 parent
d5dc2a1832
commit
81acd9df7a
5 files changed
+199
No files matched your search
Binary file not shown.
Reference in new issue
Block a user