feat(ui): Visualize Demand Planner page + interactive Forecast/Backtest pages (PRP-22)#196
Conversation
There was a problem hiding this comment.
Sorry @w7-mgfcode, your pull request is larger than the review limit of 150000 diff characters
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Implements PRP-22 (
PRPs/PRP-22-visualize-demand-planner.md). Closes #195.Turns the Visualize menu from two read-only job viewers into a business-facing demand surface — the successor to PRP-20/PRP-21 (Explorer interactivity).
What changed
Backend (additive — no migration, no new slice, no
app/main.pychange)GET /analytics/inventory-status— latestinventory_snapshot_dailyrow per(store, product)grain via PostgresDISTINCT ON; optionalstore_id/product_idfilters;200+ empty list on an empty table. NewInventoryStatusItem/InventoryStatusResponseschemas +compute_inventory_statusservice method.Frontend
Visualize → Demand Planner(/visualize/demand) — every completedpredictjob rolled into a multi-SKU table (tomorrow / next-week / next-month demand + inventory requirement), a 7/14/30-day lead-time selector, client-side sort, CSV export, and a single-SKU drill-in (demand curve + reorder breakdown + cross-links).TimeSeriesChartgains an opt-in prediction-interval band (LineChart→ComposedChart, backward-compatible — new props default off).demand-utils.ts(rollups + inventory math) with full vitest coverage; newuseInventoryStatushook; 3 new TS types.Validation
ruff/ruff format/mypy --strict/pyright --strict— cleanpytest -m "not integration"— 1105 passed; analytics integration tests — 9 passedpnpm tsc --noEmit/pnpm lint/pnpm test --run— clean (44 tests)🤖 Generated with Claude Code