feat(notes): let organizations define their own note fields

The note form was fixed. Owners can add fields and each note keeps those values.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-11-01 15:38:05 +03:30
co-authored by Cursor
parent 590f8114cc
commit 8e1e94a439
10 changed files with 572 additions and 2 deletions
@@ -0,0 +1,3 @@
ALTER TYPE "CustomFieldEntity" ADD VALUE IF NOT EXISTS 'note';
ALTER TABLE "Note" ADD COLUMN IF NOT EXISTS "customFields" JSONB NOT NULL DEFAULT '{}';
+3
View File
@@ -52,6 +52,7 @@ enum CustomFieldEntity {
person
company
deal
note
}
enum CustomFieldType {
@@ -941,6 +942,8 @@ model Note {
checklist Json?
locationText String?
analyzeEnabled Boolean @default(true)
/// مقادیر فیلدهای سفارشی یادداشت
customFields Json @default("{}")
personId String?
person Person? @relation(fields: [personId], references: [id], onDelete: SetNull)
companyId String?