@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,429 @@
1
+ /**
2
+ * Companies Entity Fields Configuration
3
+ *
4
+ * Separated from main config according to new refactoring plan.
5
+ * Contains all field definitions for the companies entity.
6
+ */
7
+
8
+ import type { EntityField } from '@nextsparkjs/core/lib/entities/types'
9
+
10
+ export const companiesFields: EntityField[] = [
11
+ {
12
+ name: 'name',
13
+ type: 'text',
14
+ required: true,
15
+ display: {
16
+ label: 'Company Name',
17
+ description: 'Company display name',
18
+ placeholder: 'Enter company name...',
19
+ showInList: true,
20
+ showInDetail: true,
21
+ showInForm: true,
22
+ order: 1,
23
+ columnWidth: 6,
24
+ },
25
+ api: {
26
+ searchable: true,
27
+ sortable: true,
28
+ readOnly: false,
29
+ },
30
+ },
31
+ {
32
+ name: 'legalName',
33
+ type: 'text',
34
+ required: false,
35
+ display: {
36
+ label: 'Legal Name',
37
+ description: 'Legal registered company name',
38
+ placeholder: 'Enter legal name...',
39
+ showInList: false,
40
+ showInDetail: true,
41
+ showInForm: true,
42
+ order: 2,
43
+ columnWidth: 6,
44
+ },
45
+ api: {
46
+ searchable: true,
47
+ sortable: true,
48
+ readOnly: false,
49
+ },
50
+ },
51
+ {
52
+ name: 'taxId',
53
+ type: 'text',
54
+ required: false,
55
+ display: {
56
+ label: 'Tax ID',
57
+ description: 'Tax identification number',
58
+ placeholder: 'Enter tax ID...',
59
+ showInList: false,
60
+ showInDetail: true,
61
+ showInForm: true,
62
+ order: 3,
63
+ columnWidth: 4,
64
+ },
65
+ api: {
66
+ searchable: true,
67
+ sortable: false,
68
+ readOnly: false,
69
+ },
70
+ },
71
+ {
72
+ name: 'website',
73
+ type: 'url',
74
+ required: false,
75
+ display: {
76
+ label: 'Website',
77
+ description: 'Company website URL',
78
+ placeholder: 'https://example.com',
79
+ showInList: true,
80
+ showInDetail: true,
81
+ showInForm: true,
82
+ order: 4,
83
+ columnWidth: 4,
84
+ },
85
+ api: {
86
+ searchable: false,
87
+ sortable: false,
88
+ readOnly: false,
89
+ },
90
+ },
91
+ {
92
+ name: 'email',
93
+ type: 'email',
94
+ required: false,
95
+ display: {
96
+ label: 'Email',
97
+ description: 'General company email',
98
+ placeholder: 'info@company.com',
99
+ showInList: true,
100
+ showInDetail: true,
101
+ showInForm: true,
102
+ order: 5,
103
+ columnWidth: 4,
104
+ },
105
+ api: {
106
+ searchable: true,
107
+ sortable: true,
108
+ readOnly: false,
109
+ },
110
+ },
111
+ {
112
+ name: 'phone',
113
+ type: 'text',
114
+ required: false,
115
+ display: {
116
+ label: 'Phone',
117
+ description: 'Main company phone number',
118
+ placeholder: 'Enter phone number...',
119
+ showInList: true,
120
+ showInDetail: true,
121
+ showInForm: true,
122
+ order: 6,
123
+ columnWidth: 4,
124
+ },
125
+ api: {
126
+ searchable: true,
127
+ sortable: false,
128
+ readOnly: false,
129
+ },
130
+ },
131
+ {
132
+ name: 'industry',
133
+ type: 'text',
134
+ required: false,
135
+ display: {
136
+ label: 'Industry',
137
+ description: 'Industry sector',
138
+ placeholder: 'Enter industry...',
139
+ showInList: true,
140
+ showInDetail: true,
141
+ showInForm: true,
142
+ order: 7,
143
+ columnWidth: 6,
144
+ },
145
+ api: {
146
+ searchable: true,
147
+ sortable: true,
148
+ readOnly: false,
149
+ },
150
+ },
151
+ {
152
+ name: 'type',
153
+ type: 'select',
154
+ required: false,
155
+ options: [
156
+ { value: 'prospect', label: 'Prospect' },
157
+ { value: 'customer', label: 'Customer' },
158
+ { value: 'partner', label: 'Partner' },
159
+ { value: 'competitor', label: 'Competitor' },
160
+ { value: 'vendor', label: 'Vendor' },
161
+ { value: 'other', label: 'Other' },
162
+ ],
163
+ display: {
164
+ label: 'Company Type',
165
+ description: 'Type of company relationship',
166
+ placeholder: 'Select type...',
167
+ showInList: true,
168
+ showInDetail: true,
169
+ showInForm: true,
170
+ order: 8,
171
+ columnWidth: 4,
172
+ },
173
+ api: {
174
+ searchable: false,
175
+ sortable: true,
176
+ readOnly: false,
177
+ },
178
+ },
179
+ {
180
+ name: 'size',
181
+ type: 'select',
182
+ required: false,
183
+ options: [
184
+ { value: '1-10', label: '1-10 employees' },
185
+ { value: '11-50', label: '11-50 employees' },
186
+ { value: '51-200', label: '51-200 employees' },
187
+ { value: '201-500', label: '201-500 employees' },
188
+ { value: '500+', label: '500+ employees' },
189
+ ],
190
+ display: {
191
+ label: 'Company Size',
192
+ description: 'Company size by employees',
193
+ placeholder: 'Select size...',
194
+ showInList: false,
195
+ showInDetail: true,
196
+ showInForm: true,
197
+ order: 9,
198
+ columnWidth: 4,
199
+ },
200
+ api: {
201
+ searchable: false,
202
+ sortable: true,
203
+ readOnly: false,
204
+ },
205
+ },
206
+ {
207
+ name: 'annualRevenue',
208
+ type: 'number',
209
+ required: false,
210
+ display: {
211
+ label: 'Annual Revenue',
212
+ description: 'Annual revenue in currency',
213
+ placeholder: '0.00',
214
+ showInList: false,
215
+ showInDetail: true,
216
+ showInForm: true,
217
+ order: 10,
218
+ columnWidth: 4,
219
+ },
220
+ api: {
221
+ searchable: false,
222
+ sortable: true,
223
+ readOnly: false,
224
+ },
225
+ },
226
+ {
227
+ name: 'address',
228
+ type: 'textarea',
229
+ required: false,
230
+ display: {
231
+ label: 'Address',
232
+ description: 'Street address',
233
+ placeholder: 'Enter address...',
234
+ showInList: false,
235
+ showInDetail: true,
236
+ showInForm: true,
237
+ order: 11,
238
+ columnWidth: 6,
239
+ },
240
+ api: {
241
+ searchable: true,
242
+ sortable: false,
243
+ readOnly: false,
244
+ },
245
+ },
246
+ {
247
+ name: 'city',
248
+ type: 'text',
249
+ required: false,
250
+ display: {
251
+ label: 'City',
252
+ description: 'City',
253
+ placeholder: 'Enter city...',
254
+ showInList: false,
255
+ showInDetail: true,
256
+ showInForm: true,
257
+ order: 12,
258
+ columnWidth: 3,
259
+ },
260
+ api: {
261
+ searchable: true,
262
+ sortable: true,
263
+ readOnly: false,
264
+ },
265
+ },
266
+ {
267
+ name: 'state',
268
+ type: 'text',
269
+ required: false,
270
+ display: {
271
+ label: 'State',
272
+ description: 'State or province',
273
+ placeholder: 'Enter state...',
274
+ showInList: false,
275
+ showInDetail: true,
276
+ showInForm: true,
277
+ order: 13,
278
+ columnWidth: 3,
279
+ },
280
+ api: {
281
+ searchable: true,
282
+ sortable: true,
283
+ readOnly: false,
284
+ },
285
+ },
286
+ {
287
+ name: 'country',
288
+ type: 'text',
289
+ required: false,
290
+ display: {
291
+ label: 'Country',
292
+ description: 'Country',
293
+ placeholder: 'US',
294
+ showInList: true,
295
+ showInDetail: true,
296
+ showInForm: true,
297
+ order: 14,
298
+ columnWidth: 3,
299
+ },
300
+ api: {
301
+ searchable: true,
302
+ sortable: true,
303
+ readOnly: false,
304
+ },
305
+ },
306
+ {
307
+ name: 'postalCode',
308
+ type: 'text',
309
+ required: false,
310
+ display: {
311
+ label: 'Postal Code',
312
+ description: 'Postal or ZIP code',
313
+ placeholder: 'Enter postal code...',
314
+ showInList: false,
315
+ showInDetail: true,
316
+ showInForm: true,
317
+ order: 15,
318
+ columnWidth: 3,
319
+ },
320
+ api: {
321
+ searchable: true,
322
+ sortable: false,
323
+ readOnly: false,
324
+ },
325
+ },
326
+ {
327
+ name: 'logo',
328
+ type: 'url',
329
+ required: false,
330
+ display: {
331
+ label: 'Logo',
332
+ description: 'Company logo URL',
333
+ placeholder: 'https://example.com/logo.png',
334
+ showInList: false,
335
+ showInDetail: true,
336
+ showInForm: true,
337
+ order: 16,
338
+ columnWidth: 6,
339
+ },
340
+ api: {
341
+ searchable: false,
342
+ sortable: false,
343
+ readOnly: false,
344
+ },
345
+ },
346
+ {
347
+ name: 'rating',
348
+ type: 'select',
349
+ required: false,
350
+ options: [
351
+ { value: 'hot', label: 'Hot' },
352
+ { value: 'warm', label: 'Warm' },
353
+ { value: 'cold', label: 'Cold' },
354
+ ],
355
+ display: {
356
+ label: 'Rating',
357
+ description: 'Sales rating',
358
+ placeholder: 'Select rating...',
359
+ showInList: true,
360
+ showInDetail: true,
361
+ showInForm: true,
362
+ order: 17,
363
+ columnWidth: 4,
364
+ },
365
+ api: {
366
+ searchable: false,
367
+ sortable: true,
368
+ readOnly: false,
369
+ },
370
+ },
371
+ {
372
+ name: 'assignedTo',
373
+ type: 'user',
374
+ required: false,
375
+ display: {
376
+ label: 'Assigned To',
377
+ description: 'Account manager assigned',
378
+ placeholder: 'Select user...',
379
+ showInList: true,
380
+ showInDetail: true,
381
+ showInForm: true,
382
+ order: 18,
383
+ columnWidth: 4,
384
+ },
385
+ api: {
386
+ searchable: false,
387
+ sortable: true,
388
+ readOnly: false,
389
+ },
390
+ },
391
+ {
392
+ name: 'createdAt',
393
+ type: 'datetime',
394
+ required: false,
395
+ display: {
396
+ label: 'Created At',
397
+ description: 'When the company was created',
398
+ showInList: true,
399
+ showInDetail: true,
400
+ showInForm: false,
401
+ order: 98,
402
+ columnWidth: 4,
403
+ },
404
+ api: {
405
+ searchable: false,
406
+ sortable: true,
407
+ readOnly: true,
408
+ },
409
+ },
410
+ {
411
+ name: 'updatedAt',
412
+ type: 'datetime',
413
+ required: false,
414
+ display: {
415
+ label: 'Updated At',
416
+ description: 'When the company was last updated',
417
+ showInList: false,
418
+ showInDetail: true,
419
+ showInForm: false,
420
+ order: 99,
421
+ columnWidth: 4,
422
+ },
423
+ api: {
424
+ searchable: false,
425
+ sortable: true,
426
+ readOnly: true,
427
+ },
428
+ },
429
+ ]