CSV-Import/-Export fuer die Masterpackliste ergaenzen #167

Closed
opened 2026-09-06 21:18:15 +02:00 by lena · 2 comments
Collaborator

Story: CSV-Import/-Export fuer die Masterpackliste ergaenzen

As a Mitglied einer Masterpackliste,
I want to die Liste als CSV exportieren und eine CSV-Datei importieren koennen,
so that ich Packlisten wie bei den anderen Listentypen sichern, teilen oder aus einer Vorlage einspielen kann.

Background

Todo-/Einkaufslisten haben CSV-Import/-Export seit #83, der Vorratsschrank seit #101/#101e. CsvListKind in ReactUi/src/utils/csvFields.ts kennt aktuell nur 'todo' | 'shopping' | 'pantry' - die Masterpackliste fehlt komplett, weder Backend-Handler noch Dialog-Anbindung.

Acceptance criteria:

  • Export erzeugt eine CSV mit den Feldern der Masterpackliste (Titel, Menge/-typ, Tags/Labels, „Nicht essenziell"-Flag je nach Datenmodell), analog zum bestehenden Shopping-/Pantry-Export.
  • Import liest dieselbe Spaltenstruktur und legt Eintraege ueber die bestehende Einzel-Erstellungs-Pipeline an (gleiches Muster wie #83s Todo-/Shopping-Import: pro Zeile ein bestehender Command, in einer Transaktion pro Liste).
  • CsvExportDialog/CsvImportDialog werden um kind: 'masterPacking' erweitert statt eigener Dialoge.

Out of scope for this story:

  • Aenderungen am CSV-Format der drei bereits unterstuetzten Listentypen.

Open questions: (escalate to human if unanswered)

  • Keine - reine Erweiterung eines bereits dreimal etablierten Musters (Todo/Shopping/Pantry) um den vierten Listentyp.
## Story: CSV-Import/-Export fuer die Masterpackliste ergaenzen **As a** Mitglied einer Masterpackliste, **I want to** die Liste als CSV exportieren und eine CSV-Datei importieren koennen, **so that** ich Packlisten wie bei den anderen Listentypen sichern, teilen oder aus einer Vorlage einspielen kann. ## Background Todo-/Einkaufslisten haben CSV-Import/-Export seit #83, der Vorratsschrank seit #101/#101e. `CsvListKind` in `ReactUi/src/utils/csvFields.ts` kennt aktuell nur `'todo' | 'shopping' | 'pantry'` - die Masterpackliste fehlt komplett, weder Backend-Handler noch Dialog-Anbindung. **Acceptance criteria:** - [ ] Export erzeugt eine CSV mit den Feldern der Masterpackliste (Titel, Menge/-typ, Tags/Labels, „Nicht essenziell"-Flag je nach Datenmodell), analog zum bestehenden Shopping-/Pantry-Export. - [ ] Import liest dieselbe Spaltenstruktur und legt Eintraege ueber die bestehende Einzel-Erstellungs-Pipeline an (gleiches Muster wie #83s Todo-/Shopping-Import: pro Zeile ein bestehender Command, in einer Transaktion pro Liste). - [ ] `CsvExportDialog`/`CsvImportDialog` werden um `kind: 'masterPacking'` erweitert statt eigener Dialoge. **Out of scope for this story:** - Aenderungen am CSV-Format der drei bereits unterstuetzten Listentypen. **Open questions:** (escalate to human if unanswered) - Keine - reine Erweiterung eines bereits dreimal etablierten Musters (Todo/Shopping/Pantry) um den vierten Listentyp.
lena self-assigned this 2026-09-09 07:24:13 +02:00
Author
Collaborator

Claiming this one. Plan: add CsvListKind.masterPacking end-to-end mirroring the existing todo/shopping/pantry CSV import/export pattern - backend export/import handlers for MasterPackingListItemEntity (title, quantity, quantity type, labels, non-essential flag), then wire CsvExportDialog/CsvImportDialog with the new kind instead of new dialogs. Starting now.

Claiming this one. Plan: add CsvListKind.masterPacking end-to-end mirroring the existing todo/shopping/pantry CSV import/export pattern - backend export/import handlers for MasterPackingListItemEntity (title, quantity, quantity type, labels, non-essential flag), then wire CsvExportDialog/CsvImportDialog with the new kind instead of new dialogs. Starting now.
Author
Collaborator

Done, merged to master (bd294be5). Extended CsvExportDialog/CsvImportDialog with kind: "masterPacking" instead of building separate dialogs, per the story.

Scope delivered:

  • New ImportMasterPackItemsFromCsvCommand/Handler, composed through the existing CreateMasterPackItemCommand (one command per row, in a transaction) - closer to the Todo importer than Shopping/Pantry, since MasterPackItemEntity.Category is free text (no per-list managed entity to look up/auto-create). Every row always creates a new item (no name-based dedup), matching the reference/checklist nature of pack-list data.
  • CSV columns: Name (required), Category, Priority (Essential/NotEssential/Info - the full enum, not a lossy boolean), Quantity, QuantityType (Total/PerDay), Labels (comma-separated names, matched against existing list labels only, not auto-created).
  • Frontend: MasterPackingListPage now has a "List options" menu (mirroring Shopping/Pantry) with Import/Export CSV entries.
  • Existing behavior unaffected: no changes to the Todo/Shopping/Pantry CSV format.

Tests: 7 new backend handler tests (blank-name skip, free-text category passthrough, priority/quantityType parsing incl. defaults, quantity parse failure, label matching incl. unmatched-name handling, categoriesCreated always 0), 5 new frontend tests across CsvExportDialog/CsvImportDialog/MasterPackingListPage. Full suite green (891 backend, 1270 frontend).

Security: reviewed - list-scoped authorization matches every sibling handler, label ids re-validated against the list, no injection surface, no new privilege-boundary crossings.

Manually verified end-to-end against the local review container: created a list and an item, opened both dialogs, confirmed the export dialog shows the right columns and a successful GetMasterPackItemsForListQuery round-trip.

Done, merged to master (bd294be5). Extended CsvExportDialog/CsvImportDialog with kind: "masterPacking" instead of building separate dialogs, per the story. Scope delivered: - New ImportMasterPackItemsFromCsvCommand/Handler, composed through the existing CreateMasterPackItemCommand (one command per row, in a transaction) - closer to the Todo importer than Shopping/Pantry, since MasterPackItemEntity.Category is free text (no per-list managed entity to look up/auto-create). Every row always creates a new item (no name-based dedup), matching the reference/checklist nature of pack-list data. - CSV columns: Name (required), Category, Priority (Essential/NotEssential/Info - the full enum, not a lossy boolean), Quantity, QuantityType (Total/PerDay), Labels (comma-separated names, matched against existing list labels only, not auto-created). - Frontend: MasterPackingListPage now has a "List options" menu (mirroring Shopping/Pantry) with Import/Export CSV entries. - Existing behavior unaffected: no changes to the Todo/Shopping/Pantry CSV format. Tests: 7 new backend handler tests (blank-name skip, free-text category passthrough, priority/quantityType parsing incl. defaults, quantity parse failure, label matching incl. unmatched-name handling, categoriesCreated always 0), 5 new frontend tests across CsvExportDialog/CsvImportDialog/MasterPackingListPage. Full suite green (891 backend, 1270 frontend). Security: reviewed - list-scoped authorization matches every sibling handler, label ids re-validated against the list, no injection surface, no new privilege-boundary crossings. Manually verified end-to-end against the local review container: created a list and an item, opened both dialogs, confirmed the export dialog shows the right columns and a successful GetMasterPackItemsForListQuery round-trip.
lena closed this issue 2026-09-09 07:49:15 +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#167
No description provided.