@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,413 @@
1
+ /**
2
+ * Campaigns Entity Fields Configuration
3
+ *
4
+ * Separated from main config according to new refactoring plan.
5
+ * Contains all field definitions for the campaigns entity.
6
+ */
7
+
8
+ import type { EntityField } from '@nextsparkjs/core/lib/entities/types'
9
+
10
+ export const campaignsFields: EntityField[] = [
11
+ {
12
+ name: 'name',
13
+ type: 'text',
14
+ required: true,
15
+ display: {
16
+ label: 'Campaign Name',
17
+ description: 'Campaign name',
18
+ placeholder: 'Enter campaign 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: 'type',
33
+ type: 'select',
34
+ required: false,
35
+ options: [
36
+ { value: 'email', label: 'Email' },
37
+ { value: 'social', label: 'Social Media' },
38
+ { value: 'event', label: 'Event' },
39
+ { value: 'webinar', label: 'Webinar' },
40
+ { value: 'advertising', label: 'Advertising' },
41
+ { value: 'content', label: 'Content Marketing' },
42
+ { value: 'other', label: 'Other' },
43
+ ],
44
+ display: {
45
+ label: 'Campaign Type',
46
+ description: 'Type of campaign',
47
+ placeholder: 'Select type...',
48
+ showInList: true,
49
+ showInDetail: true,
50
+ showInForm: true,
51
+ order: 2,
52
+ columnWidth: 4,
53
+ },
54
+ api: {
55
+ searchable: false,
56
+ sortable: true,
57
+ readOnly: false,
58
+ },
59
+ },
60
+ {
61
+ name: 'status',
62
+ type: 'select',
63
+ required: false,
64
+ options: [
65
+ { value: 'planned', label: 'Planned' },
66
+ { value: 'active', label: 'Active' },
67
+ { value: 'paused', label: 'Paused' },
68
+ { value: 'completed', label: 'Completed' },
69
+ { value: 'cancelled', label: 'Cancelled' },
70
+ ],
71
+ display: {
72
+ label: 'Status',
73
+ description: 'Current campaign status',
74
+ placeholder: 'Select status...',
75
+ showInList: true,
76
+ showInDetail: true,
77
+ showInForm: true,
78
+ order: 3,
79
+ columnWidth: 4,
80
+ },
81
+ api: {
82
+ searchable: false,
83
+ sortable: true,
84
+ readOnly: false,
85
+ },
86
+ },
87
+ {
88
+ name: 'objective',
89
+ type: 'text',
90
+ required: false,
91
+ display: {
92
+ label: 'Objective',
93
+ description: 'Campaign objective',
94
+ placeholder: 'Enter objective...',
95
+ showInList: false,
96
+ showInDetail: true,
97
+ showInForm: true,
98
+ order: 4,
99
+ columnWidth: 6,
100
+ },
101
+ api: {
102
+ searchable: true,
103
+ sortable: false,
104
+ readOnly: false,
105
+ },
106
+ },
107
+ {
108
+ name: 'description',
109
+ type: 'textarea',
110
+ required: false,
111
+ display: {
112
+ label: 'Description',
113
+ description: 'Detailed campaign description',
114
+ placeholder: 'Enter description...',
115
+ showInList: false,
116
+ showInDetail: true,
117
+ showInForm: true,
118
+ order: 5,
119
+ columnWidth: 12,
120
+ },
121
+ api: {
122
+ searchable: true,
123
+ sortable: false,
124
+ readOnly: false,
125
+ },
126
+ },
127
+ {
128
+ name: 'startDate',
129
+ type: 'date',
130
+ required: true,
131
+ display: {
132
+ label: 'Start Date',
133
+ description: 'Campaign start date',
134
+ placeholder: 'Select date...',
135
+ showInList: true,
136
+ showInDetail: true,
137
+ showInForm: true,
138
+ order: 6,
139
+ columnWidth: 4,
140
+ },
141
+ api: {
142
+ searchable: false,
143
+ sortable: true,
144
+ readOnly: false,
145
+ },
146
+ },
147
+ {
148
+ name: 'endDate',
149
+ type: 'date',
150
+ required: true,
151
+ display: {
152
+ label: 'End Date',
153
+ description: 'Campaign end date',
154
+ placeholder: 'Select date...',
155
+ showInList: true,
156
+ showInDetail: true,
157
+ showInForm: true,
158
+ order: 7,
159
+ columnWidth: 4,
160
+ },
161
+ api: {
162
+ searchable: false,
163
+ sortable: true,
164
+ readOnly: false,
165
+ },
166
+ },
167
+ {
168
+ name: 'budget',
169
+ type: 'number',
170
+ required: false,
171
+ display: {
172
+ label: 'Budget',
173
+ description: 'Campaign budget',
174
+ placeholder: '0.00',
175
+ showInList: true,
176
+ showInDetail: true,
177
+ showInForm: true,
178
+ order: 8,
179
+ columnWidth: 4,
180
+ },
181
+ api: {
182
+ searchable: false,
183
+ sortable: true,
184
+ readOnly: false,
185
+ },
186
+ },
187
+ {
188
+ name: 'actualCost',
189
+ type: 'number',
190
+ required: false,
191
+ display: {
192
+ label: 'Actual Cost',
193
+ description: 'Actual cost spent',
194
+ placeholder: '0.00',
195
+ showInList: false,
196
+ showInDetail: true,
197
+ showInForm: true,
198
+ order: 9,
199
+ columnWidth: 4,
200
+ },
201
+ api: {
202
+ searchable: false,
203
+ sortable: true,
204
+ readOnly: false,
205
+ },
206
+ },
207
+ {
208
+ name: 'targetAudience',
209
+ type: 'text',
210
+ required: false,
211
+ display: {
212
+ label: 'Target Audience',
213
+ description: 'Target audience description',
214
+ placeholder: 'Describe target audience...',
215
+ showInList: false,
216
+ showInDetail: true,
217
+ showInForm: true,
218
+ order: 10,
219
+ columnWidth: 6,
220
+ },
221
+ api: {
222
+ searchable: true,
223
+ sortable: false,
224
+ readOnly: false,
225
+ },
226
+ },
227
+ {
228
+ name: 'targetLeads',
229
+ type: 'number',
230
+ required: false,
231
+ display: {
232
+ label: 'Target Leads',
233
+ description: 'Target number of leads',
234
+ placeholder: '0',
235
+ showInList: false,
236
+ showInDetail: true,
237
+ showInForm: true,
238
+ order: 11,
239
+ columnWidth: 3,
240
+ },
241
+ api: {
242
+ searchable: false,
243
+ sortable: true,
244
+ readOnly: false,
245
+ },
246
+ },
247
+ {
248
+ name: 'actualLeads',
249
+ type: 'number',
250
+ required: false,
251
+ display: {
252
+ label: 'Actual Leads',
253
+ description: 'Actual leads generated',
254
+ placeholder: '0',
255
+ showInList: true,
256
+ showInDetail: true,
257
+ showInForm: true,
258
+ order: 12,
259
+ columnWidth: 3,
260
+ },
261
+ api: {
262
+ searchable: false,
263
+ sortable: true,
264
+ readOnly: false,
265
+ },
266
+ },
267
+ {
268
+ name: 'targetRevenue',
269
+ type: 'number',
270
+ required: false,
271
+ display: {
272
+ label: 'Target Revenue',
273
+ description: 'Target revenue to generate',
274
+ placeholder: '0.00',
275
+ showInList: false,
276
+ showInDetail: true,
277
+ showInForm: true,
278
+ order: 13,
279
+ columnWidth: 3,
280
+ },
281
+ api: {
282
+ searchable: false,
283
+ sortable: true,
284
+ readOnly: false,
285
+ },
286
+ },
287
+ {
288
+ name: 'actualRevenue',
289
+ type: 'number',
290
+ required: false,
291
+ display: {
292
+ label: 'Actual Revenue',
293
+ description: 'Actual revenue generated',
294
+ placeholder: '0.00',
295
+ showInList: false,
296
+ showInDetail: true,
297
+ showInForm: true,
298
+ order: 14,
299
+ columnWidth: 3,
300
+ },
301
+ api: {
302
+ searchable: false,
303
+ sortable: true,
304
+ readOnly: false,
305
+ },
306
+ },
307
+ {
308
+ name: 'roi',
309
+ type: 'number',
310
+ required: false,
311
+ display: {
312
+ label: 'ROI (%)',
313
+ description: 'Return on investment percentage',
314
+ showInList: true,
315
+ showInDetail: true,
316
+ showInForm: false,
317
+ order: 15,
318
+ columnWidth: 3,
319
+ },
320
+ api: {
321
+ searchable: false,
322
+ sortable: true,
323
+ readOnly: true,
324
+ },
325
+ },
326
+ {
327
+ name: 'channel',
328
+ type: 'select',
329
+ required: false,
330
+ options: [
331
+ { value: 'email', label: 'Email' },
332
+ { value: 'social_media', label: 'Social Media' },
333
+ { value: 'web', label: 'Web' },
334
+ { value: 'print', label: 'Print' },
335
+ { value: 'tv', label: 'TV' },
336
+ { value: 'radio', label: 'Radio' },
337
+ { value: 'other', label: 'Other' },
338
+ ],
339
+ display: {
340
+ label: 'Main Channel',
341
+ description: 'Main campaign channel',
342
+ placeholder: 'Select channel...',
343
+ showInList: false,
344
+ showInDetail: true,
345
+ showInForm: true,
346
+ order: 16,
347
+ columnWidth: 4,
348
+ },
349
+ api: {
350
+ searchable: false,
351
+ sortable: true,
352
+ readOnly: false,
353
+ },
354
+ },
355
+ {
356
+ name: 'assignedTo',
357
+ type: 'user',
358
+ required: false,
359
+ display: {
360
+ label: 'Campaign Manager',
361
+ description: 'Campaign manager assigned',
362
+ placeholder: 'Select user...',
363
+ showInList: true,
364
+ showInDetail: true,
365
+ showInForm: true,
366
+ order: 17,
367
+ columnWidth: 4,
368
+ },
369
+ api: {
370
+ searchable: false,
371
+ sortable: true,
372
+ readOnly: false,
373
+ },
374
+ },
375
+ {
376
+ name: 'createdAt',
377
+ type: 'datetime',
378
+ required: false,
379
+ display: {
380
+ label: 'Created At',
381
+ description: 'When the campaign was created',
382
+ showInList: true,
383
+ showInDetail: true,
384
+ showInForm: false,
385
+ order: 98,
386
+ columnWidth: 4,
387
+ },
388
+ api: {
389
+ searchable: false,
390
+ sortable: true,
391
+ readOnly: true,
392
+ },
393
+ },
394
+ {
395
+ name: 'updatedAt',
396
+ type: 'datetime',
397
+ required: false,
398
+ display: {
399
+ label: 'Updated At',
400
+ description: 'When the campaign was last updated',
401
+ showInList: false,
402
+ showInDetail: true,
403
+ showInForm: false,
404
+ order: 99,
405
+ columnWidth: 4,
406
+ },
407
+ api: {
408
+ searchable: false,
409
+ sortable: true,
410
+ readOnly: true,
411
+ },
412
+ },
413
+ ]