Wiederkehrende Eintraege auf der Einkaufsliste (feste Turnusartikel) #183
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#183
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: Wiederkehrende Eintraege auf der Einkaufsliste (feste Turnusartikel)
As a Mitglied einer Einkaufsliste,
I want to ein Produkt als wiederkehrend markieren (z. B. Toilettenpapier alle 2 Wochen),
so that ich Standardartikel nicht jedes Mal von Hand neu eintragen muss, sondern sie automatisch wieder auf der Liste erscheinen.
Kontext (verifiziert im Code): Todos haben bereits eine vollstaendige Wiederholungsregel (RecurrencePicker.tsx, RecurrenceRule auf TodoEntity, inkl. Turnus-Zuweisung aus #157) - Einkaufslisten-Produkte (ShoppingProductEntity) haben aktuell kein Aequivalent. Das ist unabhaengig vom Vorratsschrank-basierten "unter Zielmenge nachfuellen"-Mechanismus (PantryLowStockShoppingWriter) gedacht: dieser setzt eine Vorratsschrank-Eintragung mit Zielmenge voraus, waehrend viele Einkaufslisten-Haushalte Standardartikel gar nicht im Vorratsschrank pflegen.
Acceptance criteria:
Out of scope for this story:
Open questions: (escalate to human if unanswered)
Claiming this for the current autonomous cycle. Plan: mirror the existing Todo RecurrenceRule pattern (RecurrencePicker.tsx, TodoEntity.RecurrenceRule, the roll-forward/reappear mechanism used for recurring todos) onto ShoppingProductEntity - add a recurrence-rule column, expose it in product editing via the same RecurrencePicker component where the rule vocabulary fits shopping items, and wire the recurring-product reappearance into whatever mechanism actually re-adds/reactivates a checked-off product (need to check whether shopping products are soft-deactivated or deleted on check-off before finalizing the reappearance design - investigating the code now before writing anything). No open questions per the issue body. Not overlapping with #185 (comment notifications) or #181/#186/#187 (already shipped).
Implemented and merged (
c2511a3e).Scope: a shopping-list product can now be marked as recurring (Daily/Weekly/Monthly, reusing the exact same TodoRecurrenceRule enum todos already use). Checking off a recurring product schedules its own reappearance date (anchored on the day-of-month the rule was first set, computed with the same RecurrenceCalculator todos use); a new daily sweep (RollForwardRecurringShoppingProductsCommandHandler, bundled into the existing DueNotificationJob) reactivates it once that date arrives, preserving its last-used quantity. A normal, non-recurring product behaves exactly as before (purely additive, per the AC).
Design decisions:
Tests: 15 new/extended backend handler tests across Deactivate/Activate/SetRecurrence/RollForward (including a fan-out-preserves-quantity case and a defensive never-reactivates-an-already-active-row case) plus a new ShoppingProductRecurrencePicker component test suite and extended ShoppingProductItem coverage for the repeat badge/menu. Full backend suite (1106 tests) and frontend suite (1321 tests) green after the change.
Migration: 20260911203321_AddShoppingProductRecurrence (RecurrenceRule/RecurrenceAnchorDay/RecurrenceNextDate columns on ShoppingProductEntity, all nullable, purely additive).