Einkaufsliste - Produkte einem Mitglied zuweisen (wie bei To-Do-Listen) #202
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#202
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: Einkaufsliste - Produkte einem Mitglied zuweisen
As a Mitglied einer geteilten Einkaufsliste,
I want to ein Produkt einer bestimmten Person zuweisen,
so that klar ist, wer es besorgen soll - genau wie bei To-Do-Listen (
#16).Kontext (verifiziert im Code): Fuer Todos existiert bereits
AssigneeId/AssignTodoCommand(#16) mit Zuweisungs-Picker (AssignmentPicker.tsx) und Avatar-Anzeige (AssigneeBadge.tsx).ShoppingProductEntityhat aktuell kein Assignee-Feld.GetShoppingListMembersQuery(Mitgliederliste der Einkaufsliste) existiert bereits (#89) und kann fuer den Picker wiederverwendet werden.Acceptance criteria:
#16Out of scope for this story:
NotificationKind.TodoAssigned) - der Code behandelt Einkaufsliste/Pantry/Masterpack bisher bewusst als "kein Item-Assignee"; wird nur mitgenommen, wenn der Zusatzaufwand gering bleibt, ist aber kein hartes Muss fuer diese StorysubscribeToDtoChanges) - bleibt unveraendert, keine Ausweitung in dieser StoryBlockers: None
Priority: Should - vom Nutzer direkt angefragte Kernfunktion fuer geteilte Einkaufslisten, analog zur bereits bestehenden Todo-Funktion.
Claimed. Plan: add nullable AssigneeId/Assignee (UserId, FK -> UserEntity, ON DELETE SET NULL) to ShoppingProductEntity with a migration; extend ShoppingProductDto with an assignee DTO and thread it through every existing ShoppingProductDto projection site in Checkly/Features/Shopping/; add AssignShoppingProductCommand + handler modeled on AssignTodoCommandHandler (validate product exists, validate assignee is a ShoppingListToUserEntity member, ExecuteUpdateAsync, authorize via AuthorizeShoppingListAccessForCurrentUserQuery); frontend: a shopping-product assignment picker + AssigneeBadge reuse wired into ShoppingProductItem.tsx same as TodoItem.tsx; backend + frontend tests mirroring AssignTodoCommandHandlerTests.cs and AssignmentPicker.test.tsx. Notifications and product-level WS sync are out of scope per the story.
Done, pushed as
dc186876.Scope delivered:
#16); validates the target is a member of the list via ShoppingListToUserEntity before assigning.Tests: new AssignShoppingProductCommandHandlerTests.cs (assign/unassign/reassign, non-member rejection, cross-list product rejection) + assignment-clearing tests added to Remove/LeaveShoppingListCommandHandlerTests, an assignee-preservation regression test on RenameShoppingProductCommandHandlerTests, and a projection test on GetShoppingProductsForListQueryHandlerTests. Frontend: ShoppingProductAssignmentPicker.test.tsx (mirrors AssignmentPicker.test.tsx) + a new assignment describe block in ShoppingProductItem.test.tsx.
Verified: dotnet test (Common.Tests 119, Checkly.WebApi.Tests 63, Checkly.Tests 1004 incl. the new ones) all green; npm run build + npx tsc -b clean; npm run coverage (141 files, 1380 tests) green; security-review pass found no findings. Local review container rebuilt and healthy at localhost:8090.
Out of scope per the story (documented in code comments): a "My products" filter, an assignment notification (NotificationKind has no ShoppingProductAssigned -
#185's existing comment-notification model is unrelated and untouched), and product-level WebSocket sync (unchanged pre-existing gap, not introduced by this story).