#104 — Bug — Barcode-Scan fragt bei unbekanntem Produkt nicht nach Kategorie, erneutes Scannen erhöht Menge statt es abzuschalten #107
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#107
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: Bug — Barcode-Scan fragt bei unbekanntem Produkt nicht nach Kategorie, erneutes Scannen erhöht Menge statt es abzuschalten
As a Nutzer der Einkaufsliste,
I want to beim Scannen eines unbekannten Barcodes nach der Kategorie gefragt zu werden, und beim
erneuten Scannen desselben Barcodes die Menge erhöht statt das Produkt von der Liste zu entfernen,
so that neu gescannte Produkte sofort richtig einsortiert sind und mehrfaches Scannen (z. B. mehrere
gleiche Packungen) korrekt gezählt wird statt das Produkt versehentlich abzuschalten.
Klärung vom 2026-08-08 (PO-Rückfrage beantwortet): Erneutes Scannen eines bereits auf der Liste
aktiven Produkts soll die Menge erhöhen (nicht abhaken/deaktivieren, nicht duplizieren).
Verifiziert im Code:
ScanShoppingProductBarcodeCommandHandler: Trifft der Barcode ein existierendes, bereits aktivesProdukt, wird es aktuell deaktiviert (
existing.IsOnList ? deactivateHandler : activateHandler) —das ist das beobachtete "verschwindet von der Liste".
FallbackNameruft der HandlerCreateShoppingProductCommandHandlerohneexplizite
CategoryIdauf; dieser versucht zwar die globale Kategorie-Wissensbasis(
ShoppingCategoryResolver.ResolveFromKnowledgeBase), aber wenn der Produktname dort unbekannt ist,bleibt das Produkt kategorielos ("Sonstiges") —
ShoppingBarcodeScanDialog.tsxfragt in diesem Fallaktuell nie nach einer Kategorie.
Acceptance criteria:
dessen Menge um 1 erhöht (rein numerische Mengen; bei nicht-numerischer oder fehlender Menge greift
dieselbe Fallback-Logik wie bei
#90's Mengen-Konsolidierung), statt es zu deaktivieren.aktiviert.
Eintrag in der globalen Kategorie-Wissensbasis gefunden, fragt der Dialog vor dem Anlegen nach einer
Kategorie (analog zum Kategorie-Picker aus Smart-Add), statt das Produkt kommentarlos in "Sonstiges"
einzusortieren.
Story
#103's "keine überflüssige Nachfrage, wenn das System es schon weiß").Delivered 2026-08-08:
ScanShoppingProductBarcodeCommandHandler: matching an existing product now always (re)activates viaActivateShoppingProductCommand; the deactivate-on-rescan branch and itsIHandler<DeactivateShoppingProductCommand,...>dependency were removed entirely. A newly-added
IncrementQuantityhelper bumps a purely-numeric quantityby one (missing quantity →
"2"), leaves non-numeric quantities untouched, and is skipped entirely whenreactivating an inactive product (quantity carried over unchanged).
ShoppingBarcodeScanDialog.tsxgained the same category-picker step#103added toSmartAddInput: if theproduct returned after typing a fallback name has no
categoryId, the dialog shows the category listinstead of closing, and picking one calls
MoveShoppingProductCommandon the already-created product(no duplicate).
ShoppingListPage.tsxnow passescategories/productsthrough to the dialog.ScanShoppingProductBarcodeCommandHandlerTests.cs(increment from noquantity, increment from numeric, non-numeric left untouched, activation-only leaves quantity unchanged).
Frontend: 3 new tests in
ShoppingBarcodeScanDialog.test.tsxfor the category-picker step.triggers the category picker; picking a category moves rather than duplicates the product; rescanning an
active product increments its quantity across repeated scans (null → "2" → "3") instead of toggling it
off the list.
dotnet watchcansilently fail to auto-restart from when run backgrounded/non-interactively — a stale process kept serving
pre-fix behavior during manual verification. Worked around by killing the stale
dotnet/CqsTodo.WebApiprocesses and restarting
dotnet watchfresh; worth remembering for future backend signature changes.Out of scope for this story:
#103).