#105 — Feste Standard-Kategorie für Einkaufslisten statt wählbarer Default-Kategorie #108
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#108
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: Feste Standard-Kategorie für Einkaufslisten statt wählbarer Default-Kategorie
As a Nutzer der Einkaufsliste,
I want to keine Kategorie mehr manuell als "Default" festlegen können,
so that es immer genau eine feste, immer vorhandene Auffang-Kategorie für unkategorisierte Produkte
gibt, ohne dass ich diese Einstellung verwalten muss.
Klärung vom 2026-08-08 (PO-Rückfrage beantwortet): Betrifft ausschließlich Einkaufslisten-Kategorien.
Todo-Listen behalten ihre wählbare Default-Kategorie (
SetDefaultCategoryCommand) unverändert — die beidenKonzepte sind pro Listentyp unabhängig implementiert, es gibt keine geteilte Komponente, die versehentlich
mitbetroffen wäre.
Hintergrund: Aktuell kann jede Kategorie einer Einkaufsliste per
SetDefaultShoppingCategoryCommand(UI:
ShoppingCategoryManager.tsx) als Default markiert werden — die erste der 14 vordefinierten Sektionenist zwar initial Default, das ist aber änderbar. Diese Story macht die erste Sektion effektiv permanent zur
Default-Kategorie einer Liste.
Acceptance criteria:
SetDefaultShoppingCategoryCommand/SetDefaultShoppingCategoryCommandHandlersowie der zugehörigeUI-Trigger in
ShoppingCategoryManager.tsxentfallen ersatzlos.IsDefault-Kategorie (unverändert von#90'sDatenmodell/Migration) — sie wird beim Anlegen der Liste gesetzt und ist danach nicht mehr änderbar.
(bestehende Logik in
ShoppingCategoryResolver/CreateShoppingProductCommandHandlerbleibtunverändert).
aktuelle
IsDefault-Kategorie unverändert (kein rückwirkendes Zurücksetzen auf die ursprünglich ersteSektion nötig) — diese Story verhindert nur künftige Änderungen, sie korrigiert keine Bestandsdaten.
(
DeleteShoppingCategoryCommandHandler's Reassignment-Logik) bleibt unverändert und weiterhin nötig,da eine Liste nie ganz ohne Default-Kategorie dastehen darf.
Out of scope for this story:
SetDefaultCategoryCommand) — bleiben wie bisher wählbar.Implementation notes (2026-08-08)
Picked up in a cycle running in parallel with another session working
#104(barcode scan) — chosenspecifically because it shares no files with
ScanShoppingProductBarcodeCommandHandler/ShoppingBarcodeScanDialog.tsx, so the two streams could proceed independently with no merge risk.Straight deletion, no new code:
SetDefaultShoppingCategoryCommand/SetDefaultShoppingCategoryCommandHandler.csand its test removed outright — the backend's route table is built by reflecting over every
IRequesttype (
EndpointRouteBuilderExtensions.MapRequests), so deleting the record type also deletes thePOST /api/SetDefaultShoppingCategoryCommandendpoint, no separate route deregistration needed.ShoppingCategoryManager.tsx'ssetDefault()function and its conditional "Set default" button wereremoved; the
isDefault ? <span>Default</span> : <Button>Set default</Button>ternary collapsed to aplain
isDefault && <span>Default</span>. Regenerated the OpenAPI spec(
SWAGGER_GEN=1 dotnet tool run swagger tofile) and the frontend's generated schema(
npm run generate:api) to confirmApiRequestMapno longer has an entry for the removed command —tsc -bpassing after the frontend edit is direct proof no other call site still referenced it.No backend behavior change beyond removing the mutator:
CreateShoppingListCommandHandleralready setsIsDefault = trueonly on the first of the 14 seeded sections and never again;CreateShoppingCategoryCommandHandler/ShoppingCategoryResolver's auto-created categories alreadydefault
IsDefaulttofalse;DeleteShoppingCategoryCommandHandler's refusal to delete the defaultcategory (or the last remaining one) was already unconditional. Removing the only mutator makes the
"exactly one default category per list, never zero" invariant stronger (now immutable post-creation)
rather than introducing a gap — confirmed via the
security-reviewskill (self-invoked per07_team_coach_memory.md's note that/code-reviewcan't invoke itself), zero findings.Verified:
dotnet build Cqs.sln -c Release(0 errors),dotnet test Cqs.sln -c Release(706/706passing — Docker was available this cycle, so this includes the real
DbTestContext-backed Shoppingsuite, not just a Docker-skipped subset),
npm run build(tsc + vite, clean), fullvitest run(755/755 passing). See
docs/features/done/105_shopping_fixed_default_category.md's move for thefinal state.