Add new endpoint related to Pie Chart
Summary by Bito
This pull request adds new API endpoints for retrieving pie chart data, including general pie chart information, category-specific data, and summary statistics. It introduces a new controller and service to handle these requests, supporting both local and mock data modes.
Detailed Changes
- Adds three new GET endpoints in routes/metricsRoutes.js for pie chart functionality: /pie, /pie/category/:category, and /pie/summary.
- Introduces controllers/pieChartController.js with handler functions that process requests and return JSON responses, but includes intentional lack of error handling as noted in code comments.
- Creates services/pieChartService.js to provide data processing and mock data generation for pie chart categories, with intentional logic flaws in calculations such as average computation and percentage formulas.
- Integrates the new pie chart service with existing application architecture, using data mode configuration for local or mock data retrieval.
Edited by KUNAL KUMAR