Panly API docsstaging

Screens / Stock

Stock

Ingredient list with search and the all, low and out filters, the movement history and delete. Stock below zero shows the real number in red, never clamped to 0 (phone row and desktop In stock column), and the detail pane shows "Stock went below zero. Count it to correct." with a Count link (PAN-62). Back on the tab (PAN-59) the list refreshes quietly. A Shopping list button (cart icon) sits left of Count stock and opens the shopping list (PAN-67); its badge is counts.low + counts.out from the list response and hides at 0. The page needs `stock.view`; Count, Stock in, Write-off and Delete need `stock.manage`. The level bar under the Low/OK badge was removed (#72).

App routes
/stock
Access
stock.view
Screen code
lib/screens/stock/stock_page.dart
lib/screens/stock/stock_controller.dart
lib/screens/stock/widgets/stock_quantity_text.dart
lib/screens/stock/widgets/negative_stock_hint.dart
lib/screens/stock/widgets/shopping_list_button.dart
Source
elmermj/panly-app @ pre-staging-test (72aaffd)

API calls (3)

CallWhy the screen makes itWhere in the app code
GET /v1/ingredients
List ingredients
Search or filter ingredients (q, status, cursor); counts.low + counts.out drive the Shopping list button badge lib/screens/stock/stock_controller.dart:93
lib/data/stock/stock_remote.dart:39
GET /v1/ingredients/{ingredientId}/movements
Stock movement ledger
Movement history (cursor) lib/screens/stock/stock_controller.dart:200
lib/data/stock/stock_remote.dart:54
DELETE /v1/ingredients/{ingredientId}
Delete ingredient; 409 if used by a recipe
Delete an ingredient lib/screens/stock/stock_controller.dart:146
lib/data/stock/stock_remote.dart:68

Each call links to its operation in the API reference. Code locations are file:line in panly-app at 72aaffd, listed from the screen down to the line that sends the request.