@nextsparkjs/theme-crm 0.1.0-beta.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (140) hide show
  1. package/CRM_PLAN.md +343 -0
  2. package/about.md +122 -0
  3. package/config/app.config.ts +185 -0
  4. package/config/billing.config.ts +187 -0
  5. package/config/dashboard.config.ts +372 -0
  6. package/config/dev.config.ts +55 -0
  7. package/config/features.config.ts +336 -0
  8. package/config/flows.config.ts +511 -0
  9. package/config/permissions.config.ts +297 -0
  10. package/config/theme.config.ts +111 -0
  11. package/entities/activities/activities.config.ts +61 -0
  12. package/entities/activities/activities.fields.ts +362 -0
  13. package/entities/activities/activities.service.ts +503 -0
  14. package/entities/activities/activities.types.ts +117 -0
  15. package/entities/activities/messages/en.json +123 -0
  16. package/entities/activities/messages/es.json +123 -0
  17. package/entities/activities/migrations/020_activities_table.sql +123 -0
  18. package/entities/activities/migrations/021_activities_metas.sql +114 -0
  19. package/entities/activities/migrations/022_activities_sample_data.sql +420 -0
  20. package/entities/campaigns/campaigns.config.ts +61 -0
  21. package/entities/campaigns/campaigns.fields.ts +413 -0
  22. package/entities/campaigns/campaigns.service.ts +426 -0
  23. package/entities/campaigns/campaigns.types.ts +124 -0
  24. package/entities/campaigns/messages/en.json +145 -0
  25. package/entities/campaigns/messages/es.json +145 -0
  26. package/entities/campaigns/migrations/001_campaigns_table.sql +127 -0
  27. package/entities/campaigns/migrations/002_campaigns_metas.sql +114 -0
  28. package/entities/campaigns/migrations/003_campaigns_sample_data.sql +364 -0
  29. package/entities/companies/companies.config.ts +61 -0
  30. package/entities/companies/companies.fields.ts +429 -0
  31. package/entities/companies/companies.service.ts +566 -0
  32. package/entities/companies/companies.types.ts +125 -0
  33. package/entities/companies/messages/en.json +146 -0
  34. package/entities/companies/messages/es.json +146 -0
  35. package/entities/companies/migrations/001_companies_table.sql +150 -0
  36. package/entities/companies/migrations/002_companies_metas.sql +114 -0
  37. package/entities/companies/migrations/003_companies_sample_data.sql +246 -0
  38. package/entities/contacts/contacts.config.ts +61 -0
  39. package/entities/contacts/contacts.fields.ts +359 -0
  40. package/entities/contacts/contacts.service.ts +509 -0
  41. package/entities/contacts/contacts.types.ts +108 -0
  42. package/entities/contacts/messages/en.json +117 -0
  43. package/entities/contacts/messages/es.json +117 -0
  44. package/entities/contacts/migrations/001_contacts_table.sql +134 -0
  45. package/entities/contacts/migrations/002_contacts_metas.sql +114 -0
  46. package/entities/contacts/migrations/003_contacts_sample_data.sql +421 -0
  47. package/entities/leads/leads.config.ts +61 -0
  48. package/entities/leads/leads.fields.ts +336 -0
  49. package/entities/leads/leads.service.ts +496 -0
  50. package/entities/leads/leads.types.ts +114 -0
  51. package/entities/leads/messages/en.json +132 -0
  52. package/entities/leads/messages/es.json +132 -0
  53. package/entities/leads/migrations/001_leads_table.sql +150 -0
  54. package/entities/leads/migrations/002_leads_metas.sql +120 -0
  55. package/entities/leads/migrations/003_leads_sample_data.sql +242 -0
  56. package/entities/notes/messages/en.json +114 -0
  57. package/entities/notes/messages/es.json +114 -0
  58. package/entities/notes/migrations/020_notes_table.sql +118 -0
  59. package/entities/notes/migrations/021_notes_metas.sql +114 -0
  60. package/entities/notes/migrations/022_notes_sample_data.sql +275 -0
  61. package/entities/notes/notes.config.ts +61 -0
  62. package/entities/notes/notes.fields.ts +283 -0
  63. package/entities/notes/notes.service.ts +320 -0
  64. package/entities/notes/notes.types.ts +102 -0
  65. package/entities/opportunities/messages/en.json +107 -0
  66. package/entities/opportunities/messages/es.json +107 -0
  67. package/entities/opportunities/migrations/010_opportunities_table.sql +145 -0
  68. package/entities/opportunities/migrations/011_opportunities_metas.sql +114 -0
  69. package/entities/opportunities/migrations/012_opportunities_sample_data.sql +438 -0
  70. package/entities/opportunities/opportunities.config.ts +61 -0
  71. package/entities/opportunities/opportunities.fields.ts +416 -0
  72. package/entities/opportunities/opportunities.service.ts +525 -0
  73. package/entities/opportunities/opportunities.types.ts +135 -0
  74. package/entities/pipelines/messages/en.json +115 -0
  75. package/entities/pipelines/messages/es.json +115 -0
  76. package/entities/pipelines/migrations/001_pipelines_table.sql +106 -0
  77. package/entities/pipelines/migrations/002_pipelines_metas.sql +114 -0
  78. package/entities/pipelines/migrations/003_pipelines_sample_data.sql +91 -0
  79. package/entities/pipelines/pipelines.config.ts +62 -0
  80. package/entities/pipelines/pipelines.fields.ts +193 -0
  81. package/entities/pipelines/pipelines.service.ts +383 -0
  82. package/entities/pipelines/pipelines.types.ts +78 -0
  83. package/entities/products/messages/en.json +135 -0
  84. package/entities/products/messages/es.json +135 -0
  85. package/entities/products/migrations/001_products_table.sql +117 -0
  86. package/entities/products/migrations/002_products_metas.sql +114 -0
  87. package/entities/products/migrations/003_products_sample_data.sql +247 -0
  88. package/entities/products/products.config.ts +62 -0
  89. package/entities/products/products.fields.ts +361 -0
  90. package/entities/products/products.service.ts +437 -0
  91. package/entities/products/products.types.ts +125 -0
  92. package/lib/crm-constants.ts +77 -0
  93. package/lib/crm-utils.ts +185 -0
  94. package/lib/selectors.ts +333 -0
  95. package/messages/en.json +131 -0
  96. package/messages/es.json +131 -0
  97. package/migrations/999_theme_sample_data.sql +473 -0
  98. package/package.json +18 -0
  99. package/pendings.md +205 -0
  100. package/permissions-matrix.md +216 -0
  101. package/styles/components.css +414 -0
  102. package/styles/crm-theme.css +358 -0
  103. package/styles/globals.css +576 -0
  104. package/styles/variables.css +111 -0
  105. package/templates/dashboard/(main)/activities/components/ActivityCard.tsx +169 -0
  106. package/templates/dashboard/(main)/activities/components/ActivityTimeline.tsx +165 -0
  107. package/templates/dashboard/(main)/activities/page.tsx +297 -0
  108. package/templates/dashboard/(main)/campaigns/page.tsx +373 -0
  109. package/templates/dashboard/(main)/companies/page.tsx +296 -0
  110. package/templates/dashboard/(main)/contacts/page.tsx +347 -0
  111. package/templates/dashboard/(main)/layout.tsx +98 -0
  112. package/templates/dashboard/(main)/leads/page.tsx +335 -0
  113. package/templates/dashboard/(main)/opportunities/[id]/edit/page.tsx +95 -0
  114. package/templates/dashboard/(main)/opportunities/create/page.tsx +94 -0
  115. package/templates/dashboard/(main)/opportunities/page.tsx +350 -0
  116. package/templates/dashboard/(main)/pipelines/[id]/edit/page.tsx +95 -0
  117. package/templates/dashboard/(main)/pipelines/[id]/page.tsx +143 -0
  118. package/templates/dashboard/(main)/pipelines/create/page.tsx +94 -0
  119. package/templates/dashboard/(main)/pipelines/page.tsx +234 -0
  120. package/templates/dashboard/(main)/products/[id]/edit/page.tsx +97 -0
  121. package/templates/dashboard/(main)/products/[id]/page.tsx +509 -0
  122. package/templates/dashboard/(main)/products/create/page.tsx +96 -0
  123. package/templates/dashboard/(main)/products/page.tsx +308 -0
  124. package/templates/shared/ActionButtons.tsx +41 -0
  125. package/templates/shared/CRMDashboard.tsx +519 -0
  126. package/templates/shared/CRMDataTable.tsx +441 -0
  127. package/templates/shared/CRMMetricCard.tsx +76 -0
  128. package/templates/shared/CRMMobileNav.tsx +172 -0
  129. package/templates/shared/CRMSidebar.tsx +346 -0
  130. package/templates/shared/CRMTopBar.tsx +265 -0
  131. package/templates/shared/DealCard.tsx +123 -0
  132. package/templates/shared/EntityCard.tsx +58 -0
  133. package/templates/shared/OpportunityForm.tsx +649 -0
  134. package/templates/shared/PipelineForm.tsx +367 -0
  135. package/templates/shared/PipelineKanban.tsx +194 -0
  136. package/templates/shared/QuickFilters.tsx +47 -0
  137. package/templates/shared/StageColumn.tsx +175 -0
  138. package/templates/shared/StageSelect.tsx +177 -0
  139. package/templates/shared/StagesRepeater.tsx +317 -0
  140. package/templates/shared/index.ts +9 -0
@@ -0,0 +1,275 @@
1
+ -- ============================================================================
2
+ -- Sample data for notes table - CRM Theme
3
+ -- Aligned with schema in 001_notes_table.sql
4
+ -- Uses users from 999_theme_sample_data.sql
5
+ -- References contacts, companies, opportunities from their sample data
6
+ -- ============================================================================
7
+
8
+ -- Clean existing notes data
9
+ DELETE FROM "notes" WHERE "teamId" = 'team-crm-company';
10
+
11
+ INSERT INTO "notes" (
12
+ id,
13
+ title,
14
+ content,
15
+ type,
16
+ "isPinned",
17
+ "isPrivate",
18
+ "contactId",
19
+ "companyId",
20
+ "opportunityId",
21
+ attachments,
22
+ "userId",
23
+ "teamId",
24
+ "createdAt",
25
+ "updatedAt"
26
+ ) VALUES
27
+ -- Contact-related Notes
28
+ (
29
+ 'note-crm-001',
30
+ 'Amanda Davis - Expansion Discussion',
31
+ 'Amanda is very happy with current CRM performance. Mentioned they are growing rapidly and may need to add 50+ users by Q2. Interested in advanced analytics module and custom integrations. She has budget authority up to $100K.',
32
+ 'meeting',
33
+ true,
34
+ false,
35
+ 'contact-crm-001',
36
+ 'company-crm-001',
37
+ NULL,
38
+ '[]'::jsonb,
39
+ 'usr-crm-sales-mgr',
40
+ 'team-crm-company',
41
+ NOW() - INTERVAL '7 days',
42
+ NOW() - INTERVAL '7 days'
43
+ ),
44
+ (
45
+ 'note-crm-002',
46
+ 'Dr. Martinez Security Concerns',
47
+ 'Dr. Martinez raised important questions about data encryption at rest and in transit. Needs documentation for their security review board. Also asked about disaster recovery procedures and data backup frequency. Very thorough and detail-oriented.',
48
+ 'call',
49
+ false,
50
+ false,
51
+ 'contact-crm-006',
52
+ 'company-crm-003',
53
+ NULL,
54
+ '[{"name": "Security_Assessment_Report.pdf", "url": "https://example.com/security-report.pdf"}]'::jsonb,
55
+ 'usr-crm-sales-mgr',
56
+ 'team-crm-company',
57
+ NOW() - INTERVAL '1 day',
58
+ NOW() - INTERVAL '1 day'
59
+ ),
60
+ (
61
+ 'note-crm-003',
62
+ 'Elizabeth Taylor - Technical Architecture',
63
+ 'Elizabeth wants to review our technical architecture in detail. She is concerned about scalability and performance with their user base of 5000+ employees. Needs load testing results and performance benchmarks.',
64
+ 'email',
65
+ false,
66
+ true,
67
+ 'contact-crm-008',
68
+ 'company-crm-004',
69
+ 'opp-crm-007',
70
+ '[{"name": "Performance_Benchmarks.xlsx", "url": "https://example.com/benchmarks.xlsx"}]'::jsonb,
71
+ 'usr-crm-sales-rep',
72
+ 'team-crm-company',
73
+ NOW() - INTERVAL '5 days',
74
+ NOW() - INTERVAL '5 days'
75
+ ),
76
+ (
77
+ 'note-crm-004',
78
+ 'Maria Gonzalez Demo Notes',
79
+ 'Key points for Maria Gonzalez demo: 1) Student lifecycle management, 2) Parent communication tools, 3) Academic tracking, 4) Integration with LMS. She specifically asked about FERPA compliance.',
80
+ 'general',
81
+ true,
82
+ false,
83
+ 'contact-crm-010',
84
+ 'company-crm-005',
85
+ 'opp-crm-008',
86
+ '[]'::jsonb,
87
+ 'usr-crm-sales-rep',
88
+ 'team-crm-company',
89
+ NOW() - INTERVAL '1 day',
90
+ NOW() - INTERVAL '1 day'
91
+ ),
92
+
93
+ -- Company-related Notes
94
+ (
95
+ 'note-crm-005',
96
+ 'TechnoSoft Implementation Success Story',
97
+ 'Excellent case study material - 40% increase in sales productivity, 60% reduction in data entry time, 95% user adoption rate. Amanda Davis is willing to be a reference customer and participate in case studies.',
98
+ 'general',
99
+ true,
100
+ false,
101
+ NULL,
102
+ 'company-crm-001',
103
+ NULL,
104
+ '[{"name": "TechnoSoft_Case_Study_Draft.docx", "url": "https://example.com/case-study.docx"}]'::jsonb,
105
+ 'usr-crm-ceo',
106
+ 'team-crm-company',
107
+ NOW() - INTERVAL '15 days',
108
+ NOW() - INTERVAL '10 days'
109
+ ),
110
+ (
111
+ 'note-crm-006',
112
+ 'Global Manufacturing Integration Challenges',
113
+ 'Complex integration requirements with legacy ERP system (SAP R/3). Will need custom connector development. IT team is cautious about changes but operations team is pushing for modernization. Political dynamics to navigate.',
114
+ 'general',
115
+ true,
116
+ true,
117
+ NULL,
118
+ 'company-crm-002',
119
+ NULL,
120
+ '[]'::jsonb,
121
+ 'usr-crm-sales-rep',
122
+ 'team-crm-company',
123
+ NOW() - INTERVAL '10 days',
124
+ NOW() - INTERVAL '5 days'
125
+ ),
126
+ (
127
+ 'note-crm-007',
128
+ 'StartupTech Growth Trajectory',
129
+ 'Fast-growing startup, secured Series A funding. Currently 25 employees but planning to reach 75 by end of year. Need scalable solution that can grow with them. Price sensitive but understand value of good systems.',
130
+ 'general',
131
+ false,
132
+ false,
133
+ NULL,
134
+ 'company-crm-007',
135
+ NULL,
136
+ '[]'::jsonb,
137
+ 'usr-crm-sales-rep',
138
+ 'team-crm-company',
139
+ NOW() - INTERVAL '5 days',
140
+ NOW() - INTERVAL '1 day'
141
+ ),
142
+ (
143
+ 'note-crm-008',
144
+ 'FinanceFirst Technical Requirements',
145
+ 'Technical requirements summary: 1) Single Sign-On with Active Directory, 2) API rate limiting of 10,000 calls/hour, 3) Data encryption AES-256, 4) Audit logging for all user actions, 5) Backup every 6 hours, 6) 99.9% uptime SLA requirement.',
146
+ 'general',
147
+ false,
148
+ false,
149
+ NULL,
150
+ 'company-crm-004',
151
+ NULL,
152
+ '[{"name": "Technical_Requirements_FinanceFirst.pdf", "url": "https://example.com/tech-requirements.pdf"}]'::jsonb,
153
+ 'usr-crm-sales-rep',
154
+ 'team-crm-company',
155
+ NOW() - INTERVAL '25 days',
156
+ NOW() - INTERVAL '20 days'
157
+ ),
158
+
159
+ -- Opportunity-related Notes
160
+ (
161
+ 'note-crm-009',
162
+ 'TechnoSoft Enterprise Deal Strategy',
163
+ 'This is our biggest opportunity this quarter. Amanda has full decision authority but needs to present to board in February. Focus on ROI metrics and competitive differentiation. Main competitor is Salesforce but we have advantage on customization.',
164
+ 'general',
165
+ true,
166
+ true,
167
+ NULL,
168
+ NULL,
169
+ 'opp-crm-001',
170
+ '[{"name": "ROI_Analysis_TechnoSoft.xlsx", "url": "https://example.com/roi-analysis.xlsx"}]'::jsonb,
171
+ 'usr-crm-sales-mgr',
172
+ 'team-crm-company',
173
+ NOW() - INTERVAL '20 days',
174
+ NOW() - INTERVAL '2 days'
175
+ ),
176
+ (
177
+ 'note-crm-010',
178
+ 'Global Manufacturing Budget Cycle',
179
+ 'Budget approval process is complex - needs CFO and CIO approval. Best chance is to get into their Q1 2025 budget cycle. John Patterson is champion but needs ammunition for business case. Focus on operational efficiency gains.',
180
+ 'general',
181
+ true,
182
+ false,
183
+ NULL,
184
+ NULL,
185
+ 'opp-crm-003',
186
+ '[]'::jsonb,
187
+ 'usr-crm-sales-rep',
188
+ 'team-crm-company',
189
+ NOW() - INTERVAL '30 days',
190
+ NOW() - INTERVAL '15 days'
191
+ ),
192
+ (
193
+ 'note-crm-011',
194
+ 'FinanceFirst Competitive Intelligence',
195
+ 'Learned from Elizabeth that they are also evaluating Microsoft Dynamics and HubSpot. Our advantages: better financial services compliance, more flexible reporting. Weaknesses: higher price point, newer in market. Strategy: emphasize security and compliance.',
196
+ 'general',
197
+ true,
198
+ true,
199
+ NULL,
200
+ NULL,
201
+ 'opp-crm-007',
202
+ '[]'::jsonb,
203
+ 'usr-crm-sales-rep',
204
+ 'team-crm-company',
205
+ NOW() - INTERVAL '12 days',
206
+ NOW() - INTERVAL '8 days'
207
+ ),
208
+ (
209
+ 'note-crm-012',
210
+ 'EduTech Stakeholder Meeting Summary',
211
+ 'Meeting with Maria (Product), Kevin (Engineering), and Finance director. All aligned on need for CRM. Main concerns: 1) Student data privacy, 2) Integration with existing LMS, 3) Training for non-technical staff. Decision timeline: end of Q1 2025.',
212
+ 'meeting',
213
+ true,
214
+ false,
215
+ NULL,
216
+ NULL,
217
+ 'opp-crm-008',
218
+ '[]'::jsonb,
219
+ 'usr-crm-sales-rep',
220
+ 'team-crm-company',
221
+ NOW() - INTERVAL '3 days',
222
+ NOW() - INTERVAL '1 day'
223
+ ),
224
+
225
+ -- Call Follow-up Notes
226
+ (
227
+ 'note-crm-013',
228
+ 'Amanda Davis Call Follow-up Items',
229
+ 'Action items from call: 1) Send technical architecture document, 2) Provide API documentation, 3) Schedule demo with development team, 4) Send pricing for Pro vs Enterprise tiers. She seemed very engaged and asked good questions.',
230
+ 'call',
231
+ false,
232
+ false,
233
+ 'contact-crm-001',
234
+ 'company-crm-001',
235
+ 'opp-crm-001',
236
+ '[]'::jsonb,
237
+ 'usr-crm-sales-mgr',
238
+ 'team-crm-company',
239
+ NOW() - INTERVAL '3 days',
240
+ NOW() - INTERVAL '3 days'
241
+ ),
242
+ (
243
+ 'note-crm-014',
244
+ 'Enterprise Proposal Feedback',
245
+ 'Received feedback on enterprise proposal from Amanda. She likes the implementation timeline and training approach. Questioned the data migration timeline - thinks 2 weeks might be tight. Also asked about additional customization options.',
246
+ 'general',
247
+ false,
248
+ false,
249
+ 'contact-crm-001',
250
+ 'company-crm-001',
251
+ 'opp-crm-001',
252
+ '[]'::jsonb,
253
+ 'usr-crm-sales-mgr',
254
+ 'team-crm-company',
255
+ NOW() - INTERVAL '8 days',
256
+ NOW() - INTERVAL '8 days'
257
+ ),
258
+
259
+ -- Healthcare Demo Prep
260
+ (
261
+ 'note-crm-015',
262
+ 'Healthcare Demo Preparation Notes',
263
+ 'Key points for Healthcare Innovations demo: 1) HIPAA compliance features, 2) Patient data encryption, 3) Audit logging, 4) Integration with EMR systems, 5) Role-based access controls. Patricia specifically asked about data residency and backup procedures.',
264
+ 'general',
265
+ true,
266
+ false,
267
+ 'contact-crm-006',
268
+ 'company-crm-003',
269
+ 'opp-crm-005',
270
+ '[{"name": "HIPAA_Compliance_Checklist.pdf", "url": "https://example.com/hipaa-checklist.pdf"}]'::jsonb,
271
+ 'usr-crm-sales-mgr',
272
+ 'team-crm-company',
273
+ NOW() - INTERVAL '1 day',
274
+ NOW() - INTERVAL '1 day'
275
+ );
@@ -0,0 +1,61 @@
1
+ /**
2
+ * Notes Entity Configuration - CRM
3
+ *
4
+ * Notes and comments on CRM records.
5
+ * Updated with team support and granular permissions.
6
+ */
7
+
8
+ import { FileText } from 'lucide-react'
9
+ import type { EntityConfig } from '@nextsparkjs/core/lib/entities/types'
10
+ import { notesFields } from './notes.fields'
11
+
12
+ export const notesEntityConfig: EntityConfig = {
13
+ // ==========================================
14
+ // 1. BASIC IDENTIFICATION
15
+ // ==========================================
16
+ slug: 'notes',
17
+ enabled: true,
18
+ names: {
19
+ singular: 'note',
20
+ plural: 'Notes'
21
+ },
22
+ icon: FileText,
23
+
24
+ // ==========================================
25
+ // 2. ACCESS AND SCOPE CONFIGURATION
26
+ // ==========================================
27
+ access: {
28
+ public: false,
29
+ api: true,
30
+ metadata: false,
31
+ shared: true
32
+ },
33
+
34
+ // ==========================================
35
+ // 3. UI/UX FEATURES
36
+ // ==========================================
37
+ ui: {
38
+ dashboard: {
39
+ showInMenu: false, // Notes shown within other entities
40
+ showInTopbar: false
41
+ },
42
+ public: {
43
+ hasArchivePage: false,
44
+ hasSinglePage: false
45
+ },
46
+ features: {
47
+ searchable: true,
48
+ sortable: true,
49
+ filterable: true,
50
+ bulkOperations: false,
51
+ importExport: false
52
+ }
53
+ },
54
+
55
+ // ==========================================
56
+ // FIELDS
57
+ // ==========================================
58
+ fields: notesFields,
59
+ }
60
+
61
+ export default notesEntityConfig
@@ -0,0 +1,283 @@
1
+ /**
2
+ * Notes Entity Fields Configuration
3
+ *
4
+ * Separated from main config according to new refactoring plan.
5
+ * Contains all field definitions for the notes entity.
6
+ */
7
+
8
+ import type { EntityField } from '@nextsparkjs/core/lib/entities/types'
9
+
10
+ export const notesFields: EntityField[] = [
11
+ {
12
+ name: 'title',
13
+ type: 'text',
14
+ required: false,
15
+ display: {
16
+ label: 'Title',
17
+ description: 'Note title (optional)',
18
+ placeholder: 'Enter title...',
19
+ showInList: true,
20
+ showInDetail: true,
21
+ showInForm: true,
22
+ order: 1,
23
+ columnWidth: 8,
24
+ },
25
+ api: {
26
+ searchable: true,
27
+ sortable: true,
28
+ readOnly: false,
29
+ },
30
+ },
31
+ {
32
+ name: 'content',
33
+ type: 'textarea',
34
+ required: true,
35
+ display: {
36
+ label: 'Content',
37
+ description: 'Note content',
38
+ placeholder: 'Enter note content...',
39
+ showInList: true,
40
+ showInDetail: true,
41
+ showInForm: true,
42
+ order: 2,
43
+ columnWidth: 12,
44
+ },
45
+ api: {
46
+ searchable: true,
47
+ sortable: false,
48
+ readOnly: false,
49
+ },
50
+ },
51
+ {
52
+ name: 'type',
53
+ type: 'select',
54
+ required: false,
55
+ options: [
56
+ { value: 'general', label: 'General' },
57
+ { value: 'call', label: 'Call Note' },
58
+ { value: 'meeting', label: 'Meeting Note' },
59
+ { value: 'email', label: 'Email Note' },
60
+ { value: 'followup', label: 'Follow-up' },
61
+ { value: 'feedback', label: 'Feedback' },
62
+ { value: 'reminder', label: 'Reminder' },
63
+ ],
64
+ display: {
65
+ label: 'Note Type',
66
+ description: 'Type of note',
67
+ placeholder: 'Select type...',
68
+ showInList: true,
69
+ showInDetail: true,
70
+ showInForm: true,
71
+ order: 3,
72
+ columnWidth: 4,
73
+ },
74
+ api: {
75
+ searchable: false,
76
+ sortable: true,
77
+ readOnly: false,
78
+ },
79
+ },
80
+ {
81
+ name: 'isPinned',
82
+ type: 'boolean',
83
+ required: false,
84
+ display: {
85
+ label: 'Pinned',
86
+ description: 'Is note pinned/important',
87
+ showInList: true,
88
+ showInDetail: true,
89
+ showInForm: true,
90
+ order: 4,
91
+ columnWidth: 4,
92
+ },
93
+ api: {
94
+ searchable: false,
95
+ sortable: true,
96
+ readOnly: false,
97
+ },
98
+ },
99
+ {
100
+ name: 'isPrivate',
101
+ type: 'boolean',
102
+ required: false,
103
+ display: {
104
+ label: 'Private',
105
+ description: 'Is note private to creator',
106
+ showInList: true,
107
+ showInDetail: true,
108
+ showInForm: true,
109
+ order: 5,
110
+ columnWidth: 4,
111
+ },
112
+ api: {
113
+ searchable: false,
114
+ sortable: true,
115
+ readOnly: false,
116
+ },
117
+ },
118
+ {
119
+ name: 'entityType',
120
+ type: 'select',
121
+ required: false,
122
+ options: [
123
+ { value: 'lead', label: 'Lead' },
124
+ { value: 'contact', label: 'Contact' },
125
+ { value: 'company', label: 'Company' },
126
+ { value: 'opportunity', label: 'Opportunity' },
127
+ { value: 'campaign', label: 'Campaign' },
128
+ ],
129
+ display: {
130
+ label: 'Related Entity Type',
131
+ description: 'Type of related entity',
132
+ placeholder: 'Select entity type...',
133
+ showInList: false,
134
+ showInDetail: true,
135
+ showInForm: true,
136
+ order: 6,
137
+ columnWidth: 4,
138
+ },
139
+ api: {
140
+ searchable: false,
141
+ sortable: true,
142
+ readOnly: false,
143
+ },
144
+ },
145
+ {
146
+ name: 'entityId',
147
+ type: 'text',
148
+ required: false,
149
+ display: {
150
+ label: 'Related Entity ID',
151
+ description: 'ID of related entity',
152
+ placeholder: 'Entity ID...',
153
+ showInList: false,
154
+ showInDetail: true,
155
+ showInForm: true,
156
+ order: 7,
157
+ columnWidth: 4,
158
+ },
159
+ api: {
160
+ searchable: false,
161
+ sortable: false,
162
+ readOnly: false,
163
+ },
164
+ },
165
+ {
166
+ name: 'contactId',
167
+ type: 'relation',
168
+ required: false,
169
+ display: {
170
+ label: 'Contact',
171
+ description: 'Related contact',
172
+ placeholder: 'Select contact...',
173
+ showInList: true,
174
+ showInDetail: true,
175
+ showInForm: true,
176
+ order: 8,
177
+ columnWidth: 4,
178
+ },
179
+ api: {
180
+ searchable: false,
181
+ sortable: true,
182
+ readOnly: false,
183
+ },
184
+ },
185
+ {
186
+ name: 'companyId',
187
+ type: 'relation',
188
+ required: false,
189
+ display: {
190
+ label: 'Company',
191
+ description: 'Related company',
192
+ placeholder: 'Select company...',
193
+ showInList: false,
194
+ showInDetail: true,
195
+ showInForm: true,
196
+ order: 9,
197
+ columnWidth: 4,
198
+ },
199
+ api: {
200
+ searchable: false,
201
+ sortable: true,
202
+ readOnly: false,
203
+ },
204
+ },
205
+ {
206
+ name: 'opportunityId',
207
+ type: 'relation',
208
+ required: false,
209
+ display: {
210
+ label: 'Opportunity',
211
+ description: 'Related opportunity',
212
+ placeholder: 'Select opportunity...',
213
+ showInList: false,
214
+ showInDetail: true,
215
+ showInForm: true,
216
+ order: 10,
217
+ columnWidth: 4,
218
+ },
219
+ api: {
220
+ searchable: false,
221
+ sortable: true,
222
+ readOnly: false,
223
+ },
224
+ },
225
+ {
226
+ name: 'attachments',
227
+ type: 'json',
228
+ required: false,
229
+ display: {
230
+ label: 'Attachments',
231
+ description: 'Array of attachment objects',
232
+ placeholder: 'Add attachments...',
233
+ showInList: false,
234
+ showInDetail: true,
235
+ showInForm: true,
236
+ order: 11,
237
+ columnWidth: 12,
238
+ },
239
+ api: {
240
+ searchable: false,
241
+ sortable: false,
242
+ readOnly: false,
243
+ },
244
+ },
245
+ {
246
+ name: 'createdAt',
247
+ type: 'datetime',
248
+ required: false,
249
+ display: {
250
+ label: 'Created At',
251
+ description: 'When the note was created',
252
+ showInList: true,
253
+ showInDetail: true,
254
+ showInForm: false,
255
+ order: 98,
256
+ columnWidth: 4,
257
+ },
258
+ api: {
259
+ searchable: false,
260
+ sortable: true,
261
+ readOnly: true,
262
+ },
263
+ },
264
+ {
265
+ name: 'updatedAt',
266
+ type: 'datetime',
267
+ required: false,
268
+ display: {
269
+ label: 'Updated At',
270
+ description: 'When the note was last updated',
271
+ showInList: false,
272
+ showInDetail: true,
273
+ showInForm: false,
274
+ order: 99,
275
+ columnWidth: 4,
276
+ },
277
+ api: {
278
+ searchable: false,
279
+ sortable: true,
280
+ readOnly: true,
281
+ },
282
+ },
283
+ ]