## LNbits Inventory Extension – MVP Roadmap ### Phase 1 – Core Review and Validation * [x] Verify and test all existing CRUD endpoints (inventories, items, managers, categories) * [x] Ensure manager item flow works (manager-created items are inactive until admin approval) * [x] Confirm database migrations run and tables are created correctly * [x] Add missing UI validation and feedback messages (inventory, item, manager dialogs) --- ### Phase 2 – Tag System and Filtering * [x] Add `tags` field to `items` table (array or JSON list) * [x] Update Pydantic models (`CreateItem`, `Item`, `PublicItem`) to include `tags` * [x] Modify `get_inventory_items_paginated` to filter by tag (optional `?tag=` param) * [x] Update `index.js` item dialog to allow tag selection (multiselect) * [x] Add tag filter to Admin item table --- ### Phase 3 – Webhooks and Stock Sync * [x] Create `/api/v1/webhooks/stock-update` endpoint to receive stock change events * [x] Implement internal handler to adjust `quantity_in_stock` when webhook triggered * [x] Add test POST route for external integrations to simulate webhook calls * [x] Log all webhook updates (inventory_id, item_id, change, timestamp) --- ### Phase 4 – Low Stock Alerts and Admin Dashboard * [ ] Add `reorder_threshold` logic: identify items below this threshold * [ ] Extend `tasks.py` with background task checking low stock periodically * [ ] Store low stock notifications in a simple log or cache table * [ ] Create Admin “Dashboard” page with the following sections: * [ ] Overview (inventory count, total items, active vs inactive) * [ ] Stock summary (total stock value, items in stock, out of stock) * [ ] Low stock list (items below reorder threshold) * [ ] Pending manager submissions (inactive items) * [ ] Webhook / integration status (recent callbacks, last run time) * [ ] Add link to dashboard from main index --- ### Phase 5 – Manager Public Page * [ ] Create `templates/inventory/manager.html` * [ ] Implement simple UI for managers to: * [ ] Add new items (linked to their manager_id) * [ ] Edit their pending items * [ ] Delete their items (if inactive) * [ ] Display status indicators (pending approval / approved) * [ ] Add basic authentication by manager_id token or query param --- ### Phase 6 – Basic Order Logging * [ ] Reuse existing `orders` and `order_items` tables * [ ] Create `/api/v1/orders` endpoint for external apps to log completed checkouts * [ ] Calculate total, insert into `orders` + `order_items` * [ ] Decrease item stock quantities accordingly * [ ] Expose `/api/v1/orders/{inventory_id}` (read-only, admin only) * [ ] Optional: trigger webhook for external systems (if `webhook_url` configured) --- ### Phase 7 – Categories and UI Enhancements * [ ] Add category management UI (create, list, delete) * [ ] Enable category selection in item dialog * [ ] Filter items by category in Admin item table * [ ] Improve item dialog layout and validation
LNbits Inventory Extension – MVP Roadmap
Phase 1 – Core Review and Validation
Phase 2 – Tag System and Filtering
tagsfield toitemstable (array or JSON list)CreateItem,Item,PublicItem) to includetagsget_inventory_items_paginatedto filter by tag (optional?tag=param)index.jsitem dialog to allow tag selection (multiselect)Phase 3 – Webhooks and Stock Sync
/api/v1/webhooks/stock-updateendpoint to receive stock change eventsquantity_in_stockwhen webhook triggeredPhase 4 – Low Stock Alerts and Admin Dashboard
Add
reorder_thresholdlogic: identify items below this thresholdExtend
tasks.pywith background task checking low stock periodicallyStore low stock notifications in a simple log or cache table
Create Admin “Dashboard” page with the following sections:
Add link to dashboard from main index
Phase 5 – Manager Public Page
Create
templates/inventory/manager.htmlImplement simple UI for managers to:
Display status indicators (pending approval / approved)
Add basic authentication by manager_id token or query param
Phase 6 – Basic Order Logging
ordersandorder_itemstables/api/v1/ordersendpoint for external apps to log completed checkoutsorders+order_items/api/v1/orders/{inventory_id}(read-only, admin only)webhook_urlconfigured)Phase 7 – Categories and UI Enhancements