feat(products): improve replenishment-aware shopping suggestions

Replace product weight and repurchase intent fields with per-package remaining levels and inventory-first restock signals. Enrich shopping suggestions with usage-aware replenishment scoring so the frontend and LLM can prioritize real gaps and near-empty staples more reliably.
This commit is contained in:
Piotr Oleszczyk 2026-03-09 13:37:40 +01:00
parent bb5d402c15
commit d91d06455b
18 changed files with 587 additions and 210 deletions

View file

@ -24,12 +24,17 @@ def test_update_inventory_opened(client, created_product):
r2 = client.patch(
f"/inventory/{inv_id}",
json={"is_opened": True, "opened_at": "2026-01-15"},
json={
"is_opened": True,
"opened_at": "2026-01-15",
"remaining_level": "low",
},
)
assert r2.status_code == 200
data = r2.json()
assert data["is_opened"] is True
assert data["opened_at"] == "2026-01-15"
assert data["remaining_level"] == "low"
def test_update_inventory_not_found(client):