mirror of
https://github.com/lrnselfreliance/wrolpi.git
synced 2026-10-26 02:48:38 -04:00
Replace the DB-backed inventory module with a config-only design and build out food-storage tooling around it. Inventory (config-only, no database) - Each inventory is a YAML file at config/inventory/<slug>.yaml, loaded once into memory and the single source of truth. New reusable MultiFileConfig (wrolpi/common.py) manages a directory of per-entity files. - Inventory types (food/fuel/tool) seed a customizable field schema (text/number/quantity/date/select/location/calories). Unit math/aggregation moved to the frontend (mathjs); Pint dropped from the backend. - Minimal API: GET / (all inventories full), POST /, PUT /<slug> (whole- inventory save with version-based optimistic concurrency; 404 for missing), DELETE. Legacy inventories.yaml / old tables migrate to per-inventory files (pound->lb), and an alembic migration drops the tables. Frontend - New app/src/components/inventory/ package: spreadsheet-style table with Tab/Enter keyboard entry, sortable columns, expired-row highlighting, customizable field editor, and pooled cross-inventory location autocomplete. - A single useInventories store loads everything once and persists whole inventories optimistically; list/items/summary/locations derive client-side. - Summary groups items (default by Category), totals size x count, shows a calories column, and embeds a ration estimate (how long the stock lasts). Food catalog - Shared, editable catalog (config/inventory/catalog.yaml) seeded from catalog_defaults.yaml (~60 generic items, total calories per package) with merge-keep-edits + tombstones. GET/PUT /api/inventory/catalog, a management modal, and entry-row pre-fill of category/size/calories from a name match. Calculators - Generic Food Storage planner (like the Water calculator): household + editable per-person/year amounts -> total to store over a chosen duration, with women/children weighted by DGA calorie shares and an imperial/metric toggle. Also fixes ConfigFile.save() to accept nested file_names. Backend pytest and frontend jest suites updated/added throughout; alembic check clean. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
37 lines
663 B
Text
37 lines
663 B
Text
Pillow==12.2.0
|
|
PyYAML==6.0.3
|
|
SQLAlchemy[asyncio]==1.3.22
|
|
aiohttp==3.14.0
|
|
alembic==1.10.4
|
|
beautifulsoup4==4.14.3
|
|
cachetools==5.5.0
|
|
cryptography==46.0.7
|
|
ebooklib==0.20
|
|
feedparser==6.0.12
|
|
jc==1.25.6
|
|
libzim==3.10.0
|
|
mock==5.2.0
|
|
psutil==7.2.2
|
|
psycopg2-binary==2.9.12
|
|
pydantic>=2.0.0
|
|
PyMuPDF>=1.27.2.3
|
|
pytest-asyncio==1.4.0
|
|
pytest-xdist==3.8.0
|
|
pytest==9.0.3
|
|
py7zr>=1.1.0
|
|
python-docx==1.2.0
|
|
python-dotenv==1.2.2
|
|
python-magic~=0.4.27
|
|
pytz==2026.2
|
|
rarfile>=4.2
|
|
sanic-ext==25.12.0
|
|
sanic-testing==24.6.0
|
|
sanic==25.12.1
|
|
secretstorage==3.5.0
|
|
selenium==4.44.0
|
|
srt==3.5.3
|
|
tqdm==4.67.3
|
|
vininfo[cli]==1.11.0
|
|
webvtt-py==0.5.1
|
|
yt-dlp[default,curl-cffi]>=2026.03.17
|
|
yt-dlp-ejs>=0.8.0
|