Use Tiny compositions for purchase planning
All checks were successful
Build and Deploy / build-and-deploy (push) Successful in 2m41s

This commit is contained in:
Cauê Faleiros
2026-08-03 10:22:39 -03:00
parent 1a3fed3dda
commit e993bfdaf3
11 changed files with 544 additions and 40 deletions

View File

@@ -11,6 +11,7 @@ const {
getRfmAnalytics
} = require('../services/analyticsService');
const { getProductComposition, listProductCompositions } = require('../services/productionOrderService');
const { getDataHealthSummary } = require('../services/dataHealthService');
const router = express.Router();
@@ -78,6 +79,15 @@ router.get('/analytics/product-compositions', verifyToken, async (req, res) => {
}
});
router.get('/analytics/data-health', verifyToken, async (req, res) => {
try {
res.json(await getDataHealthSummary());
} catch (error) {
console.error('Error fetching data health:', error);
res.status(500).json({ error: 'Internal Server Error' });
}
});
router.get('/analytics/clients', verifyToken, async (req, res) => {
try {
res.json(await getClientAnalytics(getClientAnalyticsFilters(req.query)));