Kommentare auf Einkaufslisten-Produkten #179
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#179
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: Kommentare auf Einkaufslisten-Produkten
As a Mitglied einer Einkaufsliste,
I want to einen Kommentar zu einem einzelnen Produkt hinterlassen (z. B. "bitte die laktosefreie Variante" oder "war beim letzten Mal schlecht"),
so that ich anderen Haushaltsmitgliedern direkt am Produkt einen Hinweis geben kann, statt es m�ndlich oder in einem separaten Chat zu kl�ren.
Kontext (verifiziert im Code): Todo (CommentList.tsx), Speisekammer (PantryCommentList.tsx) und Masterpackliste (CreateMasterPackItemCommentCommand) haben bereits Produkt-/Item-Kommentare inklusive Kommentar-Z�hler-Badge. ShoppingProductItem.tsx und die zugeh�rigen Backend-Handler haben aktuell kein �quivalent - es existiert keine ShoppingProductComment-Entity.
Acceptance criteria:
Out of scope for this story:
Open questions: (escalate to human if unanswered)
Claimed for this go-cycle (2026-09-08). This was one of 3 new candidate stories I drafted this cycle (backlog had shrunk to 2 open/unblocked issues) after researching real feature-parity gaps across the 4 full list types - see #180 (Shopping labels) and #181 (list appearance parity) for the other two. Implementation plan: new ShoppingProductCommentEntity (mirrors PantryProductCommentEntity), CreateShoppingProductCommentCommand/DeleteShoppingProductCommentCommand/GetShoppingProductCommentsQuery (mirrors the Pantry equivalents), a commentCount field added to ShoppingProductDto via GetShoppingProductsForListQuery's projection, and a ShoppingCommentList.tsx frontend component mirroring PantryCommentList.tsx, wired into ShoppingProductItem.tsx's comment badge/toggle the same way Pantry's is.
Implemented, tested, and verified end-to-end.
Scope: ShoppingProductCommentEntity mirrors the existing Todo/Pantry comment pattern - Create/Get/Delete handlers authorized via list access, delete restricted to the comment's own author or a list owner (AuthorizeShoppingProductCommentDeleteAccessQueryHandler). GetShoppingProductsForListQuery now projects a CommentCount alongside each product row. Frontend: ShoppingCommentList.tsx (fetch-on-mount, mirrors PantryCommentList.tsx) wired into ShoppingProductItem's badge and overflow menu.
Acceptance criteria: all four met - comment section per product with count badge and expand/collapse, comments visible to every list member, delete available to the comment's author, deleting the product cascades to its comments (FK ON DELETE CASCADE).
Tests: 9 new backend handler/authorization tests (Checkly.Tests, all passing, 868 total), 37 new/updated frontend tests across ShoppingCommentList.test.tsx/ShoppingProductItem.test.tsx/ShoppingBarcodeScanDialog.test.tsx (all passing). Manually verified end-to-end in the local review container: posted and deleted a comment on a real product, badge count updated correctly both ways.
Key decisions: no WS change event for comment mutations (same reasoning as the Pantry pendant - the frontend just refetches after posting/deleting), so onCommentsChanged triggers a full product-list refetch to pick up the new CommentCount rather than a WS push.
Note: this story's own WIP was found already partially drafted (entity/handlers/DTOs) at the start of this session but not yet merged or migrated - continued and completed it rather than restarting, per the loop's WIP-priority rule.