Add budget-aware restocking - #252
Open
Manish567Kumar wants to merge 1 commit into
Open
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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):
ordersso dashboard revenue and fulfilment aggregates are not inflated by demo submissions.Frontend: