Vorratsschrank — Mindesthaltbarkeitsdatum je Produkt mit "laeuft bald ab"-Markierung #164
Labels
No labels
priority/could
priority/must
priority/should
priority/wont
status/blocked
status/claimed
status/done-migrated
type/bug
type/feature
type/infra
type/tech-debt
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
robert/todo#164
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Story: Vorratsschrank — Mindesthaltbarkeitsdatum je Produkt mit "laeuft bald ab"-Markierung
As a Mitglied, das Lebensmittel in den Vorratsschrank eintraegt,
I want to ein Mindesthaltbarkeitsdatum je Produkt hinterlegen koennen,
so that wir nicht mehr Lebensmittel wegwerfen, deren baldiger Ablauf niemandem aufgefallen ist.
Background
Der Vorratsschrank speichert bereits Barcode, Label, Menge und Zielmenge je Produkt (
PantryProductEntity), aber kein Ablauf-/Mindesthaltbarkeitsdatum - genau die eine Angabe, die fuer Lebensmittelverschwendung im Haushalt am relevantesten waere, fehlt bisher komplett (keinExpir*/BestBefore/ShelfLife-Feld irgendwo inFeatures/PantryoderPantryItem.tsx).Acceptance criteria:
PantryProductEntitybekommt ein optionales Mindesthaltbarkeitsdatum, manuell setzbar (kein automatischer Vorschlag aus Barcode-/OFF-Lookup - siehe Out of scope).Out of scope for this story:
Open questions: (escalate to human if unanswered)
Entscheidungen (Mensch, 2026-09-08) - Scope erweitert/praezisiert gegenueber der urspruenglichen Story:
Damit sind alle offenen Fragen der Story beantwortet - Umsetzung kann ohne weitere Eskalation starten, allerdings mit angepassten Acceptance Criteria gegenueber der urspruenglichen Fassung (siehe oben).
Claiming this one. Resolving the open question as Product Owner (no human sign-off needed per the autonomous loop): the "expiring soon" threshold will be a fixed 3 days (not configurable per household) - keeps scope tight, matches the example given in the story, and a settings UI for this would be a disproportionate amount of new surface for a first cut. Plan: add an optional BestBeforeDate to PantryProductEntity (nullable, manually set - no barcode/OFF auto-suggestion, per the story), a SetPantryProductBestBeforeDateCommand, and compute an ExpiryStatus (None/ExpiringSoon/Expired) on the DTO/query side from BestBeforeDate vs today + the 3-day threshold; frontend shows a visual badge on PantryItem for ExpiringSoon/Expired plus a way to set/clear the date. Starting now.
Done, merged to master (
0e12e23e).Scope delivered:
Bonus fix: found and fixed a real bug in the OpenAPI schema-generation filter (NullableReferenceSchemaFilter) while wiring this up - it only checked primary-constructor parameters for nullability, so a nullable property added as a plain
{ get; init; }member (like this story's own BestBeforeDate) silently lost its nullability in the generated spec. Added regression tests for it.Tests: 9 new backend tests + 5 new frontend tests. Full suite green (908 backend, 1282 frontend).
Security: reviewed - authorization mirrors the proven sibling handler exactly, no IDOR, no injection surface, schema-filter change only fixes correctness (can't leak previously-hidden properties).
Manually verified end-to-end against the local review container: set a 2-days-out date on a real pantry product, confirmed the amber badge rendered correctly.