@@ -5,7 +5,10 @@ export const CrmDashboard = {
55 widgets : [
66 // --- KPI Row ---
77 {
8+ id : 'crm_total_revenue' ,
9+ title : 'Total Revenue' ,
810 type : 'metric' as const ,
11+ object : 'opportunity' ,
912 layout : { x : 0 , y : 0 , w : 1 , h : 1 } ,
1013 options : {
1114 label : 'Total Revenue' ,
@@ -15,7 +18,10 @@ export const CrmDashboard = {
1518 }
1619 } ,
1720 {
21+ id : 'crm_active_deals' ,
22+ title : 'Active Deals' ,
1823 type : 'metric' as const ,
24+ object : 'opportunity' ,
1925 layout : { x : 1 , y : 0 , w : 1 , h : 1 } ,
2026 options : {
2127 label : 'Active Deals' ,
@@ -25,7 +31,10 @@ export const CrmDashboard = {
2531 }
2632 } ,
2733 {
34+ id : 'crm_win_rate' ,
35+ title : 'Win Rate' ,
2836 type : 'metric' as const ,
37+ object : 'opportunity' ,
2938 layout : { x : 2 , y : 0 , w : 1 , h : 1 } ,
3039 options : {
3140 label : 'Win Rate' ,
@@ -35,7 +44,10 @@ export const CrmDashboard = {
3544 }
3645 } ,
3746 {
47+ id : 'crm_avg_deal_size' ,
48+ title : 'Avg Deal Size' ,
3849 type : 'metric' as const ,
50+ object : 'opportunity' ,
3951 layout : { x : 3 , y : 0 , w : 1 , h : 1 } ,
4052 options : {
4153 label : 'Avg Deal Size' ,
@@ -47,8 +59,13 @@ export const CrmDashboard = {
4759
4860 // --- Row 2: Charts ---
4961 {
62+ id : 'crm_revenue_trends' ,
5063 title : 'Revenue Trends' ,
51- type : 'area' as const ,
64+ type : 'area' as const ,
65+ object : 'opportunity' ,
66+ categoryField : 'month' ,
67+ valueField : 'revenue' ,
68+ aggregate : 'sum' ,
5269 layout : { x : 0 , y : 1 , w : 3 , h : 2 } ,
5370 options : {
5471 xField : 'month' ,
@@ -68,8 +85,13 @@ export const CrmDashboard = {
6885 } ,
6986 } ,
7087 {
88+ id : 'crm_lead_source' ,
7189 title : 'Lead Source' ,
7290 type : 'donut' as const ,
91+ object : 'opportunity' ,
92+ categoryField : 'source' ,
93+ valueField : 'value' ,
94+ aggregate : 'count' ,
7395 layout : { x : 3 , y : 1 , w : 1 , h : 2 } ,
7496 options : {
7597 xField : 'source' ,
@@ -88,8 +110,13 @@ export const CrmDashboard = {
88110
89111 // --- Row 3: More Charts ---
90112 {
113+ id : 'crm_pipeline_by_stage' ,
91114 title : 'Pipeline by Stage' ,
92115 type : 'bar' as const ,
116+ object : 'opportunity' ,
117+ categoryField : 'stage' ,
118+ valueField : 'amount' ,
119+ aggregate : 'sum' ,
93120 layout : { x : 0 , y : 3 , w : 2 , h : 2 } ,
94121 options : {
95122 xField : 'stage' ,
@@ -107,8 +134,13 @@ export const CrmDashboard = {
107134 } ,
108135 } ,
109136 {
137+ id : 'crm_top_products' ,
110138 title : 'Top Products' ,
111139 type : 'bar' as const ,
140+ object : 'product' ,
141+ categoryField : 'name' ,
142+ valueField : 'sales' ,
143+ aggregate : 'sum' ,
112144 layout : { x : 2 , y : 3 , w : 2 , h : 2 } ,
113145 options : {
114146 xField : 'name' ,
@@ -127,8 +159,10 @@ export const CrmDashboard = {
127159
128160 // --- Row 4: Table ---
129161 {
162+ id : 'crm_recent_opportunities' ,
130163 title : 'Recent Opportunities' ,
131164 type : 'table' as const ,
165+ object : 'opportunity' ,
132166 layout : { x : 0 , y : 5 , w : 4 , h : 2 } ,
133167 options : {
134168 columns : [
@@ -152,8 +186,13 @@ export const CrmDashboard = {
152186
153187 // --- Row 5: Dynamic KPI from Object Data ---
154188 {
189+ id : 'crm_revenue_by_account' ,
155190 title : 'Revenue by Account' ,
156191 type : 'bar' as const ,
192+ object : 'opportunity' ,
193+ categoryField : 'account' ,
194+ valueField : 'total' ,
195+ aggregate : 'sum' ,
157196 layout : { x : 0 , y : 7 , w : 4 , h : 2 } ,
158197 options : {
159198 xField : 'account' ,
0 commit comments