@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,297 @@
1
+ /**
2
+ * CRM Theme - Permissions Configuration
3
+ *
4
+ * SINGLE SOURCE OF TRUTH for all permissions and roles in this theme.
5
+ *
6
+ * This file defines:
7
+ * - teams: Team-level permissions (team.view, team.edit, etc.)
8
+ * - entities: Entity CRUD permissions (leads, contacts, companies, etc.)
9
+ * - features: Theme-specific feature permissions (reports, bulk ops, lead conversion)
10
+ *
11
+ * All sections use unified format: { action: '...', roles: [...] }
12
+ *
13
+ * Single-tenant mode with differentiated permissions:
14
+ * - Owner: CRM Administrator (full control)
15
+ * - Admin: Sales/Marketing Manager (team management + reports)
16
+ * - Member: Sales/Marketing Rep (daily operations)
17
+ * - Viewer: Read-only access
18
+ *
19
+ * Use PermissionService.canDoAction(role, action) to check any permission.
20
+ */
21
+
22
+ import type { ThemePermissionsConfig } from '@nextsparkjs/core/lib/permissions/types'
23
+
24
+ export const PERMISSIONS_CONFIG_OVERRIDES: ThemePermissionsConfig = {
25
+ // ==========================================
26
+ // TEAM PERMISSIONS
27
+ // ==========================================
28
+ // Unified format: { action, label, description, roles, dangerous? }
29
+ teams: [
30
+ // View permissions
31
+ { action: 'team.view', label: 'View Team', description: 'Can view team details', roles: ['owner', 'admin', 'member', 'viewer'] },
32
+ { action: 'team.members.view', label: 'View Members', description: 'Can see team member list', roles: ['owner', 'admin', 'member', 'viewer'] },
33
+ { action: 'team.settings.view', label: 'View Settings', description: 'Can view team settings', roles: ['owner', 'admin'] },
34
+ { action: 'team.billing.view', label: 'View Billing', description: 'Can view billing information', roles: ['owner'] },
35
+
36
+ // Edit permissions
37
+ { action: 'team.edit', label: 'Edit Team', description: 'Can modify team name and details', roles: ['owner'] },
38
+ { action: 'team.settings.edit', label: 'Edit Settings', description: 'Can modify team settings', roles: ['owner'] },
39
+ { action: 'team.billing.manage', label: 'Manage Billing', description: 'Can manage subscriptions and payments', roles: ['owner'] },
40
+
41
+ // Member management - Owner and Admin can invite in CRM
42
+ { action: 'team.members.invite', label: 'Invite Members', description: 'Invite new team members to the CRM', roles: ['owner', 'admin'] },
43
+ { action: 'team.members.remove', label: 'Remove Members', description: 'Can remove team members', roles: ['owner', 'admin'] },
44
+ { action: 'team.members.update_role', label: 'Update Roles', description: 'Only CRM admins can change user roles', roles: ['owner'] },
45
+
46
+ // Dangerous - Disabled in single-tenant
47
+ { action: 'team.delete', label: 'Delete Team', description: 'Cannot delete organization in single-tenant mode', roles: [], dangerous: true },
48
+ ],
49
+
50
+ // ==========================================
51
+ // ENTITY PERMISSIONS
52
+ // ==========================================
53
+ entities: {
54
+ // ------------------------------------------
55
+ // LEADS
56
+ // ------------------------------------------
57
+ leads: [
58
+ { action: 'create', label: 'Create leads', description: 'Can create new leads', roles: ['owner', 'admin', 'member'] },
59
+ { action: 'read', label: 'View leads', description: 'Can view lead details', roles: ['owner', 'admin', 'member', 'viewer'] },
60
+ { action: 'list', label: 'List leads', description: 'Can see the leads list', roles: ['owner', 'admin', 'member', 'viewer'] },
61
+ { action: 'update', label: 'Edit leads', description: 'Can modify lead information', roles: ['owner', 'admin', 'member'] },
62
+ { action: 'delete', label: 'Delete leads', description: 'Can delete leads', roles: ['owner', 'admin'], dangerous: true },
63
+ { action: 'assign', label: 'Assign leads', description: 'Can assign leads to team members', roles: ['owner', 'admin'] },
64
+ ],
65
+
66
+ // ------------------------------------------
67
+ // CONTACTS
68
+ // ------------------------------------------
69
+ contacts: [
70
+ { action: 'create', label: 'Create contacts', description: 'Can create new contacts', roles: ['owner', 'admin', 'member'] },
71
+ { action: 'read', label: 'View contacts', description: 'Can view contact details', roles: ['owner', 'admin', 'member', 'viewer'] },
72
+ { action: 'list', label: 'List contacts', description: 'Can see the contacts list', roles: ['owner', 'admin', 'member', 'viewer'] },
73
+ { action: 'update', label: 'Edit contacts', description: 'Can modify contact information', roles: ['owner', 'admin', 'member'] },
74
+ { action: 'delete', label: 'Delete contacts', description: 'Can delete contacts', roles: ['owner', 'admin'], dangerous: true },
75
+ ],
76
+
77
+ // ------------------------------------------
78
+ // COMPANIES
79
+ // ------------------------------------------
80
+ companies: [
81
+ { action: 'create', label: 'Create companies', description: 'Can create new companies', roles: ['owner', 'admin', 'member'] },
82
+ { action: 'read', label: 'View companies', description: 'Can view company details', roles: ['owner', 'admin', 'member', 'viewer'] },
83
+ { action: 'list', label: 'List companies', description: 'Can see the companies list', roles: ['owner', 'admin', 'member', 'viewer'] },
84
+ { action: 'update', label: 'Edit companies', description: 'Can modify company information', roles: ['owner', 'admin', 'member'] },
85
+ { action: 'delete', label: 'Delete companies', description: 'Can delete companies', roles: ['owner', 'admin'], dangerous: true },
86
+ ],
87
+
88
+ // ------------------------------------------
89
+ // OPPORTUNITIES
90
+ // ------------------------------------------
91
+ opportunities: [
92
+ { action: 'create', label: 'Create opportunities', description: 'Can create new opportunities', roles: ['owner', 'admin', 'member'] },
93
+ { action: 'read', label: 'View opportunities', description: 'Can view opportunity details', roles: ['owner', 'admin', 'member', 'viewer'] },
94
+ { action: 'list', label: 'List opportunities', description: 'Can see the opportunities list', roles: ['owner', 'admin', 'member', 'viewer'] },
95
+ { action: 'update', label: 'Edit opportunities', description: 'Can modify opportunity information', roles: ['owner', 'admin', 'member'] },
96
+ { action: 'delete', label: 'Delete opportunities', description: 'Can delete opportunities', roles: ['owner', 'admin'], dangerous: true },
97
+ { action: 'assign', label: 'Assign opportunities', description: 'Can assign opportunities to team members', roles: ['owner', 'admin'] },
98
+ ],
99
+
100
+ // ------------------------------------------
101
+ // ACTIVITIES
102
+ // ------------------------------------------
103
+ activities: [
104
+ { action: 'create', label: 'Create activities', description: 'Can schedule activities', roles: ['owner', 'admin', 'member'] },
105
+ { action: 'read', label: 'View activities', description: 'Can view activity details', roles: ['owner', 'admin', 'member', 'viewer'] },
106
+ { action: 'list', label: 'List activities', description: 'Can see the activities list', roles: ['owner', 'admin', 'member', 'viewer'] },
107
+ { action: 'update', label: 'Edit activities', description: 'Can modify activity information', roles: ['owner', 'admin', 'member'] },
108
+ { action: 'delete', label: 'Delete activities', description: 'Can delete activities', roles: ['owner', 'admin', 'member'], dangerous: true },
109
+ ],
110
+
111
+ // ------------------------------------------
112
+ // NOTES
113
+ // ------------------------------------------
114
+ notes: [
115
+ { action: 'create', label: 'Create notes', description: 'Can create notes', roles: ['owner', 'admin', 'member'] },
116
+ { action: 'read', label: 'View notes', description: 'Can view notes', roles: ['owner', 'admin', 'member', 'viewer'] },
117
+ { action: 'list', label: 'List notes', description: 'Can see notes list', roles: ['owner', 'admin', 'member', 'viewer'] },
118
+ { action: 'update', label: 'Edit notes', description: 'Can modify notes', roles: ['owner', 'admin', 'member'] },
119
+ { action: 'delete', label: 'Delete notes', description: 'Can delete notes', roles: ['owner', 'admin', 'member'], dangerous: true },
120
+ ],
121
+
122
+ // ------------------------------------------
123
+ // CAMPAIGNS
124
+ // ------------------------------------------
125
+ campaigns: [
126
+ { action: 'create', label: 'Create campaigns', description: 'Can create marketing campaigns', roles: ['owner', 'admin'] },
127
+ { action: 'read', label: 'View campaigns', description: 'Can view campaign details', roles: ['owner', 'admin', 'member', 'viewer'] },
128
+ { action: 'list', label: 'List campaigns', description: 'Can see the campaigns list', roles: ['owner', 'admin', 'member', 'viewer'] },
129
+ { action: 'update', label: 'Edit campaigns', description: 'Can modify campaign information', roles: ['owner', 'admin'] },
130
+ { action: 'delete', label: 'Delete campaigns', description: 'Can delete campaigns', roles: ['owner'], dangerous: true },
131
+ ],
132
+
133
+ // ------------------------------------------
134
+ // PRODUCTS
135
+ // ------------------------------------------
136
+ products: [
137
+ { action: 'create', label: 'Create products', description: 'Can add products to catalog', roles: ['owner'] },
138
+ { action: 'read', label: 'View products', description: 'Can view product details', roles: ['owner', 'admin', 'member', 'viewer'] },
139
+ { action: 'list', label: 'List products', description: 'Can see the products catalog', roles: ['owner', 'admin', 'member', 'viewer'] },
140
+ { action: 'update', label: 'Edit products', description: 'Can modify product information', roles: ['owner'] },
141
+ { action: 'delete', label: 'Delete products', description: 'Can delete products', roles: ['owner'], dangerous: true },
142
+ ],
143
+
144
+ // ------------------------------------------
145
+ // PIPELINES
146
+ // ------------------------------------------
147
+ pipelines: [
148
+ { action: 'create', label: 'Create pipelines', description: 'Can create sales pipelines', roles: ['owner'] },
149
+ { action: 'read', label: 'View pipelines', description: 'Can view pipeline details', roles: ['owner', 'admin', 'member', 'viewer'] },
150
+ { action: 'list', label: 'List pipelines', description: 'Can see the pipelines list', roles: ['owner', 'admin', 'member', 'viewer'] },
151
+ { action: 'update', label: 'Edit pipelines', description: 'Can modify pipeline stages', roles: ['owner'] },
152
+ { action: 'delete', label: 'Delete pipelines', description: 'Can delete pipelines', roles: ['owner'], dangerous: true },
153
+ ],
154
+ },
155
+
156
+ // ==========================================
157
+ // FEATURE PERMISSIONS
158
+ // ==========================================
159
+ // Unified format: uses 'action' instead of 'id'
160
+ features: [
161
+ // ===========================================
162
+ // REPORTS & ANALYTICS
163
+ // ===========================================
164
+ {
165
+ action: 'reports.sales',
166
+ label: 'Sales Reports',
167
+ description: 'Access to sales performance reports and analytics',
168
+ category: 'Reports',
169
+ roles: ['owner', 'admin'],
170
+ },
171
+ {
172
+ action: 'reports.marketing',
173
+ label: 'Marketing Reports',
174
+ description: 'Access to marketing campaign reports and ROI analysis',
175
+ category: 'Reports',
176
+ roles: ['owner', 'admin'],
177
+ },
178
+ {
179
+ action: 'reports.pipeline',
180
+ label: 'Pipeline Reports',
181
+ description: 'Access to pipeline analysis and forecasting reports',
182
+ category: 'Reports',
183
+ roles: ['owner', 'admin'],
184
+ },
185
+ {
186
+ action: 'reports.export',
187
+ label: 'Export Reports',
188
+ description: 'Can export reports to PDF, Excel, or CSV',
189
+ category: 'Reports',
190
+ roles: ['owner', 'admin'],
191
+ },
192
+
193
+ // ===========================================
194
+ // DASHBOARD FEATURES
195
+ // ===========================================
196
+ {
197
+ action: 'dashboard.forecasting',
198
+ label: 'Sales Forecasting',
199
+ description: 'Access to sales forecasting and projections',
200
+ category: 'Dashboard',
201
+ roles: ['owner', 'admin'],
202
+ },
203
+ {
204
+ action: 'dashboard.team_metrics',
205
+ label: 'Team Metrics',
206
+ description: 'View team performance metrics and KPIs',
207
+ category: 'Dashboard',
208
+ roles: ['owner', 'admin'],
209
+ },
210
+
211
+ // ===========================================
212
+ // BULK OPERATIONS
213
+ // ===========================================
214
+ {
215
+ action: 'bulk.import',
216
+ label: 'Bulk Import',
217
+ description: 'Can import data from CSV/Excel files',
218
+ category: 'Bulk Operations',
219
+ roles: ['owner', 'admin'],
220
+ },
221
+ {
222
+ action: 'bulk.export',
223
+ label: 'Bulk Export',
224
+ description: 'Can export data to CSV/Excel files',
225
+ category: 'Bulk Operations',
226
+ roles: ['owner', 'admin'],
227
+ },
228
+
229
+ // ===========================================
230
+ // LEAD MANAGEMENT
231
+ // ===========================================
232
+ {
233
+ action: 'leads.convert',
234
+ label: 'Convert Leads',
235
+ description: 'Can convert leads to contacts and companies',
236
+ category: 'Leads',
237
+ roles: ['owner', 'admin', 'member'],
238
+ },
239
+
240
+ // ===========================================
241
+ // CONFIGURATION
242
+ // ===========================================
243
+ {
244
+ action: 'settings.pipelines',
245
+ label: 'Pipeline Configuration',
246
+ description: 'Can create and modify sales pipelines',
247
+ category: 'Configuration',
248
+ roles: ['owner'],
249
+ },
250
+ {
251
+ action: 'settings.products',
252
+ label: 'Product Catalog',
253
+ description: 'Can manage the product catalog',
254
+ category: 'Configuration',
255
+ roles: ['owner'],
256
+ },
257
+ ],
258
+
259
+ // ==========================================
260
+ // DISABLED FEATURES
261
+ // ==========================================
262
+ disabled: [
263
+ 'teams.delete', // Cannot delete organization in single-tenant
264
+ ],
265
+
266
+ // ==========================================
267
+ // UI SECTIONS
268
+ // ==========================================
269
+ uiSections: [
270
+ {
271
+ id: 'reports',
272
+ label: 'Reports & Analytics',
273
+ description: 'Permissions for accessing reports and analytics',
274
+ categories: ['Reports', 'Dashboard'],
275
+ },
276
+ {
277
+ id: 'bulk-operations',
278
+ label: 'Bulk Operations',
279
+ description: 'Permissions for bulk data operations',
280
+ categories: ['Bulk Operations'],
281
+ },
282
+ {
283
+ id: 'lead-management',
284
+ label: 'Lead Management',
285
+ description: 'Permissions specific to lead handling',
286
+ categories: ['Leads'],
287
+ },
288
+ {
289
+ id: 'configuration',
290
+ label: 'System Configuration',
291
+ description: 'Permissions for system configuration',
292
+ categories: ['Configuration'],
293
+ },
294
+ ],
295
+ }
296
+
297
+ export default PERMISSIONS_CONFIG_OVERRIDES
@@ -0,0 +1,111 @@
1
+ /**
2
+ * CRM Theme Configuration
3
+ *
4
+ * Enterprise CRM for sales and marketing teams.
5
+ * Single-tenant mode with differentiated permissions.
6
+ */
7
+
8
+ import type { ThemeConfig } from '@nextsparkjs/core/types/theme'
9
+
10
+ export const crmThemeConfig: ThemeConfig = {
11
+ name: 'crm',
12
+ displayName: 'CRM Enterprise',
13
+ version: '2.0.0',
14
+ description: 'Complete CRM solution for sales and marketing teams',
15
+ author: 'NextSpark Team',
16
+
17
+ plugins: [],
18
+
19
+ styles: {
20
+ globals: 'globals.css',
21
+ components: 'components.css',
22
+ variables: {
23
+ '--spacing-xs': '0.125rem',
24
+ '--spacing-sm': '0.25rem',
25
+ '--spacing-md': '0.5rem',
26
+ '--spacing-lg': '1rem',
27
+ '--spacing-xl': '1.5rem',
28
+ '--spacing-2xl': '2rem'
29
+ }
30
+ },
31
+
32
+ // Professional CRM aesthetic - Purple/Violet theme with modern typography
33
+ config: {
34
+ colors: {
35
+ // Core colors - Purple/Violet Theme
36
+ background: 'oklch(0.9940 0 0)',
37
+ foreground: 'oklch(0 0 0)',
38
+ card: 'oklch(0.9940 0 0)',
39
+ 'card-foreground': 'oklch(0 0 0)',
40
+ popover: 'oklch(0.9911 0 0)',
41
+ 'popover-foreground': 'oklch(0 0 0)',
42
+ // Purple/Violet primary for modern professional look
43
+ primary: 'oklch(0.5393 0.2713 286.7462)',
44
+ 'primary-foreground': 'oklch(1.0000 0 0)',
45
+ secondary: 'oklch(0.9540 0.0063 255.4755)',
46
+ 'secondary-foreground': 'oklch(0.1344 0 0)',
47
+ muted: 'oklch(0.9702 0 0)',
48
+ 'muted-foreground': 'oklch(0.4386 0 0)',
49
+ accent: 'oklch(0.9393 0.0288 266.3680)',
50
+ 'accent-foreground': 'oklch(0.5445 0.1903 259.4848)',
51
+ destructive: 'oklch(0.6290 0.1902 23.0704)',
52
+ 'destructive-foreground': 'oklch(1.0000 0 0)',
53
+ border: 'oklch(0.9300 0.0094 286.2156)',
54
+ input: 'oklch(0.9401 0 0)',
55
+ ring: 'oklch(0 0 0)',
56
+
57
+ // Chart colors for analytics
58
+ 'chart-1': 'oklch(0.7459 0.1483 156.4499)',
59
+ 'chart-2': 'oklch(0.5393 0.2713 286.7462)',
60
+ 'chart-3': 'oklch(0.7336 0.1758 50.5517)',
61
+ 'chart-4': 'oklch(0.5828 0.1809 259.7276)',
62
+ 'chart-5': 'oklch(0.5590 0 0)',
63
+
64
+ // Sidebar - light with subtle violet tint
65
+ sidebar: 'oklch(0.9777 0.0051 247.8763)',
66
+ 'sidebar-foreground': 'oklch(0 0 0)',
67
+ 'sidebar-primary': 'oklch(0 0 0)',
68
+ 'sidebar-primary-foreground': 'oklch(1.0000 0 0)',
69
+ 'sidebar-accent': 'oklch(0.9401 0 0)',
70
+ 'sidebar-accent-foreground': 'oklch(0 0 0)',
71
+ 'sidebar-border': 'oklch(0.9401 0 0)',
72
+ 'sidebar-ring': 'oklch(0 0 0)'
73
+ },
74
+
75
+ fonts: {
76
+ sans: "'Plus Jakarta Sans', system-ui, sans-serif",
77
+ serif: "'Lora', Georgia, serif",
78
+ mono: "'IBM Plex Mono', monospace"
79
+ },
80
+
81
+ spacing: {
82
+ radius: '1.4rem',
83
+ 'radius-sm': 'calc(1.4rem - 4px)',
84
+ 'radius-md': 'calc(1.4rem - 2px)',
85
+ 'radius-lg': '1.4rem',
86
+ 'radius-xl': 'calc(1.4rem + 4px)'
87
+ },
88
+
89
+ shadows: {
90
+ 'shadow-2xs': '0px 2px 3px 0px hsl(0 0% 0% / 0.08)',
91
+ 'shadow-xs': '0px 2px 3px 0px hsl(0 0% 0% / 0.08)',
92
+ 'shadow-sm': '0px 2px 3px 0px hsl(0 0% 0% / 0.16), 0px 1px 2px -1px hsl(0 0% 0% / 0.16)',
93
+ shadow: '0px 2px 3px 0px hsl(0 0% 0% / 0.16), 0px 1px 2px -1px hsl(0 0% 0% / 0.16)',
94
+ 'shadow-md': '0px 2px 3px 0px hsl(0 0% 0% / 0.16), 0px 2px 4px -1px hsl(0 0% 0% / 0.16)',
95
+ 'shadow-lg': '0px 2px 3px 0px hsl(0 0% 0% / 0.16), 0px 4px 6px -1px hsl(0 0% 0% / 0.16)',
96
+ 'shadow-xl': '0px 2px 3px 0px hsl(0 0% 0% / 0.16), 0px 8px 10px -1px hsl(0 0% 0% / 0.16)',
97
+ 'shadow-2xl': '0px 2px 3px 0px hsl(0 0% 0% / 0.40)'
98
+ },
99
+
100
+ tracking: {
101
+ normal: '-0.025em'
102
+ }
103
+ },
104
+
105
+ components: {
106
+ overrides: {},
107
+ custom: {}
108
+ }
109
+ }
110
+
111
+ export default crmThemeConfig
@@ -0,0 +1,61 @@
1
+ /**
2
+ * Activities Entity Configuration - CRM
3
+ *
4
+ * Tasks and activities related to CRM records.
5
+ * Updated with team support and granular permissions.
6
+ */
7
+
8
+ import { Calendar } from 'lucide-react'
9
+ import type { EntityConfig } from '@nextsparkjs/core/lib/entities/types'
10
+ import { activitiesFields } from './activities.fields'
11
+
12
+ export const activitiesEntityConfig: EntityConfig = {
13
+ // ==========================================
14
+ // 1. BASIC IDENTIFICATION
15
+ // ==========================================
16
+ slug: 'activities',
17
+ enabled: true,
18
+ names: {
19
+ singular: 'activity',
20
+ plural: 'Activities'
21
+ },
22
+ icon: Calendar,
23
+
24
+ // ==========================================
25
+ // 2. ACCESS AND SCOPE CONFIGURATION
26
+ // ==========================================
27
+ access: {
28
+ public: false,
29
+ api: true,
30
+ metadata: true,
31
+ shared: true
32
+ },
33
+
34
+ // ==========================================
35
+ // 3. UI/UX FEATURES
36
+ // ==========================================
37
+ ui: {
38
+ dashboard: {
39
+ showInMenu: true,
40
+ showInTopbar: true
41
+ },
42
+ public: {
43
+ hasArchivePage: false,
44
+ hasSinglePage: false
45
+ },
46
+ features: {
47
+ searchable: true,
48
+ sortable: true,
49
+ filterable: true,
50
+ bulkOperations: true,
51
+ importExport: false
52
+ }
53
+ },
54
+
55
+ // ==========================================
56
+ // FIELDS
57
+ // ==========================================
58
+ fields: activitiesFields,
59
+ }
60
+
61
+ export default activitiesEntityConfig