1+ import { defineStack } from '@objectstack/spec' ;
12import { App } from '@objectstack/spec/ui' ;
23import { Account } from './src/domains/crm/account.object' ;
34import { Contact } from './src/domains/crm/contact.object' ;
@@ -11,12 +12,14 @@ import { CrmActions } from './src/ui/actions';
1112import { CrmDashboards } from './src/ui/dashboards' ;
1213import { CrmReports } from './src/ui/reports' ;
1314
14- export default App . create ( {
15- name : 'crm_example' ,
16- label : 'CRM App' ,
17- description : 'Comprehensive CRM example demonstrating all ObjectStack Protocol features' ,
18- version : '2.0.0' ,
19- icon : 'briefcase' ,
15+ export default defineStack ( {
16+ manifest : {
17+ id : 'com.example.crm' ,
18+ version : '2.0.0' ,
19+ type : 'app' ,
20+ name : 'CRM App' ,
21+ description : 'Comprehensive CRM example demonstrating all ObjectStack Protocol features'
22+ } ,
2023
2124 // All objects in the app
2225 objects : [
@@ -33,50 +36,7 @@ export default App.create({
3336 PipelineStatsApi ,
3437 LeadConvertApi
3538 ] ,
36-
37- // Navigation menu structure
38- navigation : [
39- {
40- id : 'group_sales' ,
41- type : 'group' ,
42- label : 'Sales' ,
43- children : [
44- { id : 'nav_lead' , type : 'object' , objectName : 'lead' , label : 'Leads' } ,
45- { id : 'nav_account' , type : 'object' , objectName : 'account' , label : 'Accounts' } ,
46- { id : 'nav_contact' , type : 'object' , objectName : 'contact' , label : 'Contacts' } ,
47- { id : 'nav_opportunity' , type : 'object' , objectName : 'opportunity' , label : 'Opportunities' } ,
48- { id : 'nav_sales_dashboard' , type : 'dashboard' , dashboardName : 'sales_dashboard' , label : 'Sales Dashboard' } ,
49- ]
50- } ,
51- {
52- id : 'group_service' ,
53- type : 'group' ,
54- label : 'Service' ,
55- children : [
56- { id : 'nav_case' , type : 'object' , objectName : 'case' , label : 'Cases' } ,
57- { id : 'nav_service_dashboard' , type : 'dashboard' , dashboardName : 'service_dashboard' , label : 'Service Dashboard' } ,
58- ]
59- } ,
60- {
61- id : 'group_activities' ,
62- type : 'group' ,
63- label : 'Activities' ,
64- children : [
65- { id : 'nav_task' , type : 'object' , objectName : 'task' , label : 'Tasks' } ,
66- ]
67- } ,
68- {
69- id : 'group_analytics' ,
70- type : 'group' ,
71- label : 'Analytics' ,
72- children : [
73- { id : 'nav_exec_dashboard' , type : 'dashboard' , dashboardName : 'executive_dashboard' , label : 'Executive Dashboard' } ,
74- { id : 'nav_analytics_sales_db' , type : 'dashboard' , dashboardName : 'sales_dashboard' , label : 'Sales Dashboard' } ,
75- { id : 'nav_analytics_service_db' , type : 'dashboard' , dashboardName : 'service_dashboard' , label : 'Service Dashboard' } ,
76- ]
77- }
78- ] ,
79-
39+
8040 // Actions available in the app
8141 actions : Object . values ( CrmActions ) ,
8242
@@ -86,10 +46,59 @@ export default App.create({
8646 // Reports
8747 reports : Object . values ( CrmReports ) ,
8848
89- // App-level branding
90- branding : {
91- primaryColor : '#4169E1' ,
92- logo : '/assets/crm-logo.png' ,
93- favicon : '/assets/crm-favicon.ico' ,
94- }
95- } ) ;
49+ apps : [
50+ App . create ( {
51+ name : 'crm_example' ,
52+ label : 'CRM App' ,
53+ icon : 'briefcase' ,
54+ branding : {
55+ primaryColor : '#4169E1' ,
56+ logo : '/assets/crm-logo.png' ,
57+ favicon : '/assets/crm-favicon.ico' ,
58+ } ,
59+
60+ // Navigation menu structure
61+ navigation : [
62+ {
63+ id : 'group_sales' ,
64+ type : 'group' ,
65+ label : 'Sales' ,
66+ children : [
67+ { id : 'nav_lead' , type : 'object' , objectName : 'lead' , label : 'Leads' } ,
68+ { id : 'nav_account' , type : 'object' , objectName : 'account' , label : 'Accounts' } ,
69+ { id : 'nav_contact' , type : 'object' , objectName : 'contact' , label : 'Contacts' } ,
70+ { id : 'nav_opportunity' , type : 'object' , objectName : 'opportunity' , label : 'Opportunities' } ,
71+ { id : 'nav_sales_dashboard' , type : 'dashboard' , dashboardName : 'sales_dashboard' , label : 'Sales Dashboard' } ,
72+ ]
73+ } ,
74+ {
75+ id : 'group_service' ,
76+ type : 'group' ,
77+ label : 'Service' ,
78+ children : [
79+ { id : 'nav_case' , type : 'object' , objectName : 'case' , label : 'Cases' } ,
80+ { id : 'nav_service_dashboard' , type : 'dashboard' , dashboardName : 'service_dashboard' , label : 'Service Dashboard' } ,
81+ ]
82+ } ,
83+ {
84+ id : 'group_activities' ,
85+ type : 'group' ,
86+ label : 'Activities' ,
87+ children : [
88+ { id : 'nav_task' , type : 'object' , objectName : 'task' , label : 'Tasks' } ,
89+ ]
90+ } ,
91+ {
92+ id : 'group_analytics' ,
93+ type : 'group' ,
94+ label : 'Analytics' ,
95+ children : [
96+ { id : 'nav_exec_dashboard' , type : 'dashboard' , dashboardName : 'executive_dashboard' , label : 'Executive Dashboard' } ,
97+ { id : 'nav_analytics_sales_db' , type : 'dashboard' , dashboardName : 'sales_dashboard' , label : 'Sales Dashboard' } ,
98+ { id : 'nav_analytics_service_db' , type : 'dashboard' , dashboardName : 'service_dashboard' , label : 'Service Dashboard' } ,
99+ ]
100+ }
101+ ]
102+ } )
103+ ]
104+ } ) ;
0 commit comments