Skip to content

Add budget-aware restocking - #252

Open
Manish567Kumar wants to merge 1 commit into
beck-source:mainfrom
Manish567Kumar:new_features
Open

Add budget-aware restocking#252
Manish567Kumar wants to merge 1 commit into
beck-source:mainfrom
Manish567Kumar:new_features

Conversation

@Manish567Kumar

Copy link
Copy Markdown

Adds a Restocking tab that recommends what to reorder and fits it to an available budget, plus a Submitted Orders table on the Orders tab.

Backend (server/main.py):

  • GET /api/restocking/candidates - prices every item needing reorder and ranks urgent-then-cheapest so a small budget clears critical shortfalls first. Returns full costs so the client can apply the budget reactively.
  • POST /api/restock-orders - validates the total against the budget and rejects an over-budget submission.
  • GET /api/restock-orders - submitted orders, newest first.
  • Restock orders are held separately from orders so dashboard revenue and fulfilment aggregates are not inflated by demo submissions.

Frontend:

  • Restocking.vue - budget slider drives a greedy fill in a computed, so dragging never re-hits the API. Funded and not-funded items shown separately.
  • Orders.vue - Submitted Orders table with a guarded date formatter; a failing restock feed cannot blank out the customer orders table.

Adds a Restocking tab that recommends what to reorder and fits it to an
available budget, plus a Submitted Orders table on the Orders tab.

Backend (server/main.py):
- GET /api/restocking/candidates - prices every item needing reorder and
  ranks urgent-then-cheapest so a small budget clears critical shortfalls
  first. Returns full costs so the client can apply the budget reactively.
- POST /api/restock-orders - validates the total against the budget and
  rejects an over-budget submission.
- GET /api/restock-orders - submitted orders, newest first.
- Restock orders are held separately from `orders` so dashboard revenue
  and fulfilment aggregates are not inflated by demo submissions.

Frontend:
- Restocking.vue - budget slider drives a greedy fill in a computed, so
  dragging never re-hits the API. Funded and not-funded items shown
  separately.
- Orders.vue - Submitted Orders table with a guarded date formatter; a
  failing restock feed cannot blank out the customer orders table.
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