mirror of
https://github.com/lrnselfreliance/wrolpi.git
synced 2026-10-26 19:01:39 -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> |
||
|---|---|---|
| .. | ||
| 00f11f309c53_filegroup_censored.py | ||
| 1a70196c05bb_download_location.py | ||
| 1c041aeee0fc_doc_indexer.py | ||
| 1f2325523525_download_destination_migrate.py | ||
| 2bfb3b50b178_tag_names_migration.py | ||
| 2fb39c1861c7_create_mapfile_table.py | ||
| 3b6918aeca4b_file_group.py | ||
| 3c33b1dae069_video_validated.py | ||
| 4b54ad052e2e_reindex_archives.py | ||
| 4c8da5502c8a_drop_channel_skip_download_videos.py | ||
| 4f03b9548f6e_file_group_effective_date_trigger.py | ||
| 5ad9efbf3570_filegroup_length.py | ||
| 6b0b249a4f81_archive_published_datetime.py | ||
| 8bdb48a486b9_video_ffprobe_json.py | ||
| 8d0d81bc9c34_channel_channel_downloads.py | ||
| 8df411232c17_video_indexes.py | ||
| 9ec4c765ef8d_remove_inventories_version.py | ||
| 26c5a62ec683_make_filegroup_directory_not_null.py | ||
| 32d96eb9122d_video_censored.py | ||
| 36cae041ad31_files.py | ||
| 053f17f07c4e_init_inventory_tables.py | ||
| 53f6780aa599_drop_urls.py | ||
| 54c19aa847da_channel_summary_indexes.py | ||
| 62acddc55091_archive_textsearch_coalesce_fix.py | ||
| 69e9754d1a63_filegroup_effective_datetime.py | ||
| 70db5ba8763d_files_rework.py | ||
| 75d34a2b442d_archive_datetime_index.py | ||
| 76add63ed225_json_to_jsonb.py | ||
| 84b6993a6091_drop_channel_next_download.py | ||
| 90ac16f9140a_remove_file_directory_and_stem.py | ||
| 170d1be52bc7_download_destination.py | ||
| 365c985893b8_ebook_creator.py | ||
| 577e414f1bc4_add_archive_collection_id_index.py | ||
| 717f36a4da94_ebook.py | ||
| 751aecf46b88_zim.py | ||
| 930b9b7adb79_wrolpi_flags.py | ||
| 1870bec7c81e_initialize_archive_tables.py | ||
| 6489cd50c889_file_stem_and_directory.py | ||
| 13542a230c78_archive_url_index.py | ||
| 31896cc29b71_archive_contents_search.py | ||
| 66407d145b76_.py | ||
| 158973fda20f_lower_filegroup_primary_path.py | ||
| 184329ed5137_downloader.py | ||
| 0400005fe2dc_video_textsearch_coalesce_fix.py | ||
| 467235201c70_download_sub_downloader.py | ||
| a1b2c3d4e5f6_add_collection_file_format.py | ||
| a2b3c4d5e6f7_drop_map_file_table.py | ||
| a7b1c2d3e4f5_collection_item_polymorphic.py | ||
| aac864072193_increase_file_size_column.py | ||
| add_unique_collection_name_kind.py | ||
| af4527503bdf_add_filegroup_directory_column.py | ||
| b2b9700f5048_fix_corrupted_media_paths.py | ||
| b2e4f6a8c1d3_drop_inventory_tables.py | ||
| b3c4d5e6f7a8_create_map_subscription_table.py | ||
| b43f70f369d0_remove_duplicate_channel_fields_.py | ||
| b97c1313f986_video_modification_datetime.py | ||
| ba98bd360b7a_add_collection_id_to_channel_model.py | ||
| bddb5e95a91e_video_textsearch_index.py | ||
| bf704baa185d_zim_flag.py | ||
| c4d5e6f7a8b9_drop_map_subscription_table.py | ||
| c72d305cf11e_download_settings.py | ||
| c9561bda3cf0_file_group_indexes.py | ||
| d0bbe45e56c3_reindex_pdfs.py | ||
| d2eace02f5b9_file_path_on_cascade.py | ||
| d4e446637f18_channel_tag.py | ||
| d5e6f7a8b9c0_doc_section.py | ||
| d8fcdb7773c0_drop_channel_link.py | ||
| d96a04eb2785_video_have_comments.py | ||
| d371333159ab_video_view_count_bigint.py | ||
| db0a1560d923_downloader_info.py | ||
| dbf05c8e8dcc_invalidate_videos_for_orphaned_video_.py | ||
| dc6637ced17b_zim_auto_search.py | ||
| e6f7a8b9c0d1_reindex_epubs_for_spine_order.py | ||
| e7f8a9b0c1d2_rename_ebook_to_doc.py | ||
| f0d0086a73d1_init_videos_tables.py | ||
| f2c6326cad29_video_source_id_index.py | ||
| f8c65e7e6802_channel_refresh.py | ||
| f38cfe4b5cb2_collections_feature.py | ||
| f7229a67e333_channel_download_missing_data.py | ||
| f9928a3b6bc5_file_directories.py | ||
| migrate_domains_to_collections.py | ||
| migrate_download_channel_to_collection.py | ||