#127 — Masterpackliste — neues Item über eigenen Popup mit Tags + Mengentyp statt Inline-Zeile #130
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#130
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: Masterpackliste — neues Item über eigenen Popup mit Tags + Mengentyp statt Inline-Zeile
As a Nutzer, der der Masterpackliste ein neues Item hinzufügt,
I want to direkt beim Anlegen alle relevanten Eigenschaften (Category, Priority, Quantity,
Climate-/Travel-Type-Tags, Mengentyp) in einem eigenen Dialog eingeben können,
so that ich nicht erst das neu angelegte Item wieder aufklappen und einzeln nachpflegen muss.
Background
Verifiziert im Code:
MasterPackingListPage.tsxsaddItemlegt ein Item aktuell nur mitnamean(
CreateMasterPackItemCommand({masterPackingListId, name})), über eine einzelne Inline-Eingabezeile.Category/Priority/Quantity/Labels müssen danach über das Aufklappen der Zeile in
MasterPackItemRow.tsxeinzeln nachgetragen werden.Neuer Aspekt aus diesem Request: ein Mengentyp-Feld ("insgesamt" vs. "pro Tag") — bislang gibt es nur
ein einzelnes
quantity-Feld ohne Bedeutung, ob es sich auf die ganze Reise oder pro Tag bezieht. WirdGrundlage für
#128(Tage-Abfrage beim Checkout).AC
MasterPackingListPage.tsx) mit Feldern: Name, Category, Priority, Quantity, Mengentyp(
Total|PerDay, DefaultTotal), sowie direkte Mehrfachauswahl bestehender Climate-/Travel-Type-Labels (analog zur bestehenden
renderLabelGroup-Logik ausMasterPackItemRow.tsx,inkl. Möglichkeit ein neues Label direkt anzulegen).
CreateMasterPackItemCommanderweitert um optionalecategory,priority,quantity,quantityType,labelIds— Backend legt Item inkl. Tags in einem Aufruf an (statt Anlegen +mehrere Folge-Requests).
QuantityType(Total|PerDay) aufMasterPackItemEntity/MasterPackItemDto,Default
Totalfür bereits bestehende Items (Migration).MasterPackItemRow.tsxs bestehende Inline-Bearbeitung bleibt für spätere Änderungen erhalten, zeigtzusätzlich den Mengentyp an/editierbar.
Out of scope
#128,blockiert durch diese Story (braucht das
QuantityType-Feld).Claiming this. Plan: add a QuantityType enum (Total|PerDay, default Total) to MasterPackItemEntity/Dto with a schema migration; extend CreateMasterPackItemCommand with optional category/priority/quantity/quantityType/labelIds so the item and its label associations are created in one call; new "Add item" dialog in the frontend with all these fields plus multi-select over existing Climate/Travel-Type labels (reusing MasterPackItemRow.tsx's existing label-group rendering) replacing the current name-only inline add row; MasterPackItemRow.tsx's existing inline edit gets a QuantityType control too.
Done. Replaced the name-only inline add-row on the Masterpackliste with a full "Add item" dialog (Name, Category, Priority, Quantity, a new QuantityType select [Total for the trip / Per day], and Climate/Travel-Type label tagging including inline new-label creation), plus a matching QuantityType control in the existing row-edit view.
Backend: new
MasterPackItemQuantityTypeenum (Total/PerDay, stored as string with a pinned sentinel), added toMasterPackItemEntity/MasterPackItemDto, EF migrationAddMasterPackItemQuantityType.CreateMasterPackItemCommandgainedQuantityTypeand an optionalLabelIdslist (tags the item with existing labels at creation time, IDOR-checked against the item's own list, same pattern as Tag/UntagMasterPackItemCommandHandler).UpdateMasterPackItemCommandgainedQuantityTypeas a required field (no silent default, matching every other field's contract).Frontend: new
AddMasterPackItemDialog.tsxwired intoMasterPackingListPage.tsx;MasterPackItemRow.tsx's expanded edit view got a QuantityType select using the same stale-closure-safe override pattern already used for Priority. Hand-maintained API mirrors (dtos.ts,valueTypes.ts) updated to match the regenerated OpenAPI schema.Tests: 8 new backend handler tests (Create: defaults, explicit QuantityType, label tagging, cross-list label rejection, duplicate-id handling; Update: field update, QuantityType change, cross-list rejection), 5 new/updated frontend component tests (dialog creation flow, quantity type + label selection, disabled-while-saving, Escape/backdrop guard, row QuantityType save, name-fallback behavior).
/code-reviewfindings, all fixed:LabelIdswere falsely rejected as "not found" (count compared against non-deduplicated input) — fixed by deduping before the comparison.isSavingguard already applied to the Cancel button — fixed, and form fields are now disabled while saving too.MasterPackItemRow.save()silently dropped a concurrent Priority/QuantityType change whenever the Name field was transiently empty — now falls back to the last-saved name instead of no-op'ing.UpdateMasterPackItemCommand.QuantityTypehad a stray default value inconsistent with every other field's "caller must state the full entity" contract — default removed.EntityNotFound.Create<T>convention used by Tag/UntagMasterPackItemCommandHandler instead of a raw exception string.A few reuse/simplification items (duplicated label-picker UI across three dialog components, the two-param save() override pattern, an avoidable refetch after inline label creation) and the single-commit-per-feature question were logged but left as-is — real but out of scope for this cycle, see the review report and
ai/roles/memory/07_team_coach_memory.md's open question.CI green on master: https://git.butzei.de/robert/todo/actions/runs/321 (all jobs incl. all 4 E2E legs).