Opus corrections/fixes/additions

This commit is contained in:
2025-06-19 15:49:31 -04:00
parent 8606a90e34
commit 2e3e81a02b
17 changed files with 741 additions and 613 deletions

View File

@@ -203,12 +203,8 @@ router.get('/vendors', async (req, res) => {
0
) as stock_turnover,
product_count,
-- Use an estimate of growth based on 7-day vs 30-day revenue
CASE
WHEN revenue_30d > 0
THEN ((revenue_7d * 4.0) / revenue_30d - 1) * 100
ELSE 0
END as growth
-- Use actual growth metrics from the vendor_metrics table
sales_growth_30d_vs_prev as growth
FROM vendor_metrics
WHERE revenue_30d > 0
ORDER BY revenue_30d DESC