Kommentare auf Einkaufslisten-Produkten #179

Closed
opened 2026-09-08 10:02:59 +02:00 by lena · 2 comments
Collaborator

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:

  • Jedes Produkt auf einer Einkaufsliste hat einen Kommentar-Bereich (analog zur Speisekammer: Badge mit Anzahl, Auf-/Zuklappen, Text hinzuf�gen/l�schen).
  • Kommentare sind f�r alle Mitglieder der Liste sichtbar, unabh�ngig davon wer sie geschrieben hat.
  • L�schen eines Kommentars ist mindestens dem Autor m�glich (wie bei den anderen Listentypen).
  • L�schen des Produkts l�scht auch seine Kommentare mit.

Out of scope for this story:

  • Benachrichtigungen bei neuen Kommentaren auf Einkaufslisten-Produkten (Todo hat das f�r Kommentare auf zugewiesenen Todos, #163) - separate Story falls gew�nscht.
  • Kommentar-Bearbeitung nach dem Absenden (Todo hat das seit #169) - kann als Folge-Story erg�nzt werden, nicht Teil dieser Story.

Open questions: (escalate to human if unanswered)

  • Keine - Datenmodell/Verhalten ist eine direkte �bertragung des bereits 3x etablierten Musters (Todo/Pantry/MasterPacking).
## 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:** - [ ] Jedes Produkt auf einer Einkaufsliste hat einen Kommentar-Bereich (analog zur Speisekammer: Badge mit Anzahl, Auf-/Zuklappen, Text hinzuf�gen/l�schen). - [ ] Kommentare sind f�r alle Mitglieder der Liste sichtbar, unabh�ngig davon wer sie geschrieben hat. - [ ] L�schen eines Kommentars ist mindestens dem Autor m�glich (wie bei den anderen Listentypen). - [ ] L�schen des Produkts l�scht auch seine Kommentare mit. **Out of scope for this story:** - Benachrichtigungen bei neuen Kommentaren auf Einkaufslisten-Produkten (Todo hat das f�r Kommentare auf zugewiesenen Todos, #163) - separate Story falls gew�nscht. - Kommentar-Bearbeitung nach dem Absenden (Todo hat das seit #169) - kann als Folge-Story erg�nzt werden, nicht Teil dieser Story. **Open questions:** (escalate to human if unanswered) - Keine - Datenmodell/Verhalten ist eine direkte �bertragung des bereits 3x etablierten Musters (Todo/Pantry/MasterPacking).
lena self-assigned this 2026-09-08 10:03:26 +02:00
Author
Collaborator

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.

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.
Author
Collaborator

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.

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.
lena closed this issue 2026-09-08 22:02:07 +02:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
robert/todo#179
No description provided.