Add nested inventory package tracking

This commit is contained in:
Joren de Graaf
2026-10-26 00:25:00 +01:00
parent 4d76a2bc9c
commit 5217c7f30c
19 changed files with 838 additions and 44 deletions
+9
View File
@@ -37,6 +37,15 @@ INVENTORY = {'type': 'object', 'properties': {
'location': {'type': 'string'}, 'category': {'type': 'string'}, 'notes': {'type': 'string'},
'opened': {'type': 'boolean'}, 'best_before': {'type': ['string', 'null'], 'format': 'date'},
'remaining_amount': {'type': ['string', 'null'], 'description': 'Only for one opened package with known size'},
'original_amount': {'type': ['string', 'null']}, 'unit': {'type': 'string'},
'pieces_per_package': {'type': ['integer', 'null'], 'minimum': 1},
'remaining_pieces': {'type': ['integer', 'null'], 'minimum': 0},
'piece_amount': {'type': ['string', 'null'], 'description': 'Explicit amount per piece in the package unit'},
'inner_packs_per_package': {'type': ['integer', 'null'], 'minimum': 1},
'pieces_per_inner_pack': {'type': ['integer', 'null'], 'minimum': 1},
'inner_pack_amount': {'type': ['string', 'null'], 'description': 'Measured amount per inner pack in the package unit'},
'inner_pack_label': {'type': 'string', 'maxLength': 40},
'piece_label': {'type': 'string', 'maxLength': 40},
}}
PRODUCT = {'type': 'object', 'required': ['name'], 'properties': {
'name': {'type': 'string', 'maxLength': 255}, 'brand': {'type': 'string', 'maxLength': 255},