feat(shopping): stats achat produit + édition quantité article

Backend :
- Migration 004 : last_purchased_at (DATE) + avg_interval_days (NUMERIC)
  sur shopping.products
- update_item : met à jour les stats au premier cochage d'un article
  lié à un produit (moyenne mobile exp. 70/30)
- ProductResponse expose les deux nouveaux champs

Frontend :
- ItemRow : long press 500ms → onEdit() (mobile) ; crayon + croix (laptop)
- ShoppingPage : modal édition quantité/unité, état editingItem
- api/shopping.ts : Product inclut last_purchased_at + avg_interval_days

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-05-25 07:08:14 +02:00
co-authored by Claude Sonnet 4.6
parent 377531d08e
commit dee7037d70
7 changed files with 171 additions and 14 deletions
+2
View File
@@ -69,6 +69,8 @@ class ProductResponse(BaseModel):
quantity_per_unit: Decimal | None
default_store_id: uuid.UUID | None
frequency_score: int
last_purchased_at: date | None
avg_interval_days: Decimal | None
image_path: str | None
thumbnail_path: str | None