Panly API docsstaging

Screens / Stock in

Stock in

Record a purchase: an expense with ingredient lines that adds stock. Each line has a unit selector limited to the ingredient's family (PAN-95), defaulting to its stock unit; "5000 g → 5 kg" shows what will be added, and `unit` is sent only when it differs from the stock unit. A new stock item can be created from the form with a unit from the fixed list.

App routes
/stock/in
Access
stock.manage
Screen code
lib/screens/stock/stock_in_page.dart
lib/screens/stock/stock_in_controller.dart
lib/screens/stock/widgets/stock_in_line_unit.dart
lib/screens/stock/widgets/new_stock_item_form.dart
Source
elmermj/panly-app @ pre-staging-test (72aaffd)

API calls (5)

CallWhy the screen makes itWhere in the app code
GET /v1/expense-categories
List expense categories
Categories for the purchase lib/screens/stock/stock_in_controller.dart:92
lib/data/stock/stock_remote.dart:77
GET /v1/ingredients/{ingredientId}
Get ingredient
Preselected ingredient lib/screens/stock/stock_in_controller.dart:97
lib/data/stock/stock_remote.dart:44
GET /v1/ingredients
List ingredients
Ingredient picker (search, pages) lib/screens/stock/stock_in_controller.dart:102
lib/screens/stock/stock_in_controller.dart:167
lib/data/stock/stock_remote.dart:39
POST /v1/ingredients
Create ingredient
Create a new ingredient inline lib/screens/stock/stock_in_controller.dart:320
lib/data/repositories/stock_repository.dart:126
lib/data/catalog/catalog_remote.dart:132
POST /v1/expenses
Create expense (ingredient lines auto-add stock)
Save the purchase with ingredient_lines lib/screens/stock/stock_in_controller.dart:282
lib/data/stock/stock_remote.dart:114

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.