Skip to content

Add Restocking tab with budget-driven demand forecast recommendations#168

Open
ryan-weidinger wants to merge 2 commits into
beck-source:mainfrom
ryan-weidinger:feature/restocking-tab
Open

Add Restocking tab with budget-driven demand forecast recommendations#168
ryan-weidinger wants to merge 2 commits into
beck-source:mainfrom
ryan-weidinger:feature/restocking-tab

Conversation

@ryan-weidinger

Copy link
Copy Markdown

Summary

  • New Restocking tab (/restocking) with a budget slider ($10K–$500K) that greedily recommends items from demand forecasts — increasing-trend items first, then stable; decreasing items excluded
  • Backend endpoint POST /api/restocking/orders creates an internal order with a 14-day delivery lead time and is_restocking_order: true flag
  • Orders tab gets a new "Submitted Restocking Orders" section (blue left border) that surfaces RST- orders separately; stat cards and status filters operate only on regular customer orders so counts are unaffected
  • Data fix: replaced fictional SKUs in demand_forecasts.json (WDG-001, BRG-102, etc.) with real inventory SKUs (PCB-001, PCB-002, TMP-201, PRS-203, HMD-202, ULS-205, PRX-204, SRV-301, SRV-302) so the recommendation algorithm can join on unit cost
  • Full EN/JA i18n coverage for all new strings
  • Architecture doc added at docs/architecture.html

Test plan

  • Navigate to Restocking tab — budget slider defaults to $100K, 7 items recommended, total ~$98,233
  • Move slider to $20K — only PCB-001 fits ($12,495 line cost)
  • Move slider to $10K — empty state: "No items fit within the current budget"
  • Click "Place Restocking Order" — success message appears
  • Navigate to Orders tab — "Submitted Restocking Orders" section shows the RST- order with expected delivery 14 days out
  • Confirm stat cards (Processing/Shipped/etc.) are unchanged by the restocking order
  • Expand the order's items dropdown — all line items visible
  • Switch to Japanese locale — all new strings render in Japanese

🤖 Generated with Claude Code

ryan-weidinger and others added 2 commits June 24, 2026 11:03
- New /restocking route with budget slider ($10K–$500K) that greedily
  selects items from demand forecasts (increasing trend first, then
  stable; decreasing excluded) within the available budget
- POST /api/restocking/orders endpoint creates an internal order with
  14-day delivery lead time and is_restocking_order flag
- Orders tab gains a "Submitted Restocking Orders" section (blue left
  border) that shows RST- orders separately from regular customer orders
- Stat cards and getOrdersByStatus() filter on regularOrders to prevent
  restocking orders from inflating Processing/Shipped/etc. counts
- Fixed demand_forecasts.json: replaced fictional SKUs (WDG-001,
  BRG-102, etc.) with real inventory SKUs (PCB-001, PCB-002, TMP-201,
  PRS-203, HMD-202, ULS-205, PRX-204, SRV-301, SRV-302)
- Full EN/JA i18n coverage for all new strings
- Added docs/architecture.html: HTML architecture overview page

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant