From c4a4727123de04037dc3c453dcc118b429a36d74 Mon Sep 17 00:00:00 2001 From: Viktor Miller Date: Fri, 16 Jan 2026 11:14:19 +0900 Subject: [PATCH] docs(02): create phase plan Phase 02: Legacy Data Extraction - 1 plan created - 3 total tasks defined - Ready for execution --- .planning/ROADMAP.md | 5 +- .planning/phases/02-legacy-data/02-01-PLAN.md | 175 ++++++++++++++++++ 2 files changed, 178 insertions(+), 2 deletions(-) create mode 100644 .planning/phases/02-legacy-data/02-01-PLAN.md diff --git a/.planning/ROADMAP.md b/.planning/ROADMAP.md index d0efc30..3c6e53f 100644 --- a/.planning/ROADMAP.md +++ b/.planning/ROADMAP.md @@ -34,10 +34,11 @@ Plans: **Goal**: Extract all furniture items, room definitions, and cbm values from legacy PHP into structured arrays **Depends on**: Phase 1 **Research**: Unlikely (internal work extracting PHP arrays) -**Plans**: TBD +**Plans**: 1 plan +**Status**: Planned Plans: -- [ ] TBD during phase planning +- [ ] 02-01: Extract furniture data from legacy PHP files ### Phase 3: Settings System **Goal**: Admin settings page with receiver email, captcha provider selection, thank you URL configuration diff --git a/.planning/phases/02-legacy-data/02-01-PLAN.md b/.planning/phases/02-legacy-data/02-01-PLAN.md new file mode 100644 index 0000000..2b31395 --- /dev/null +++ b/.planning/phases/02-legacy-data/02-01-PLAN.md @@ -0,0 +1,175 @@ +--- +phase: 02-legacy-data +plan: 01 +type: execute +depends_on: [] +files_modified: [includes/class-furniture-data.php] +--- + + +Extract all furniture items, room definitions, and cbm values from legacy PHP files into structured PHP arrays within the plugin. + +Purpose: Provide the furniture inventory data that the form rendering (Phase 4) and email generation (Phase 6) will use. Must preserve exact item names, cbm values, and room groupings from the legacy system. +Output: Furniture data class with complete structured arrays matching legacy liste.php exactly. + + + +~/.claude/get-shit-done/workflows/execute-plan.md +~/.claude/get-shit-done/templates/summary.md + + + +@.planning/PROJECT.md +@.planning/ROADMAP.md +@.planning/STATE.md +@.planning/phases/01-foundation/01-01-SUMMARY.md + +**Legacy data source:** +Path: `/Users/vmiller/Local Sites/siegel-liste/app/public/liste/liste.php` +Structure: HTML form with hidden inputs containing cbm values (e.g., ``) + +**Established patterns from Phase 1:** +- Singleton pattern for all plugin classes +- Class prefix: `Umzugsliste_` +- File structure: includes/ directory +- German labels for all text + +**Critical constraint:** +Email format must match legacy exactly — preserve item names, order, and cbm values precisely. + + + + + + Task 1: Create furniture data structure class + includes/class-furniture-data.php + +Create `Umzugsliste_Furniture_Data` class with singleton pattern. + +Structure: +- Static method `get_rooms()` returns array of room definitions +- Static method `get_furniture_items($room_key)` returns items for a specific room +- Static method `get_additional_work()` returns additional work sections +- Each furniture item: array with keys: 'name' (string), 'cbm' (float), 'montage' (bool - whether montage option exists) +- Room keys: 'wohnzimmer', 'schlafzimmer', 'arbeitszimmer', 'bad', 'kueche_esszimmer', 'kinderzimmer', 'keller' + +DO NOT add database functionality - this is pure data structure (arrays). +DO NOT fetch from API - extract from legacy files into static arrays. +WHY: Matches legacy approach (static furniture list), admin editing is future feature. + + Class file exists, can be instantiated, methods return empty arrays initially (no PHP errors) + Class created with proper structure, follows singleton pattern, no errors when loaded + + + + Task 2: Extract room furniture definitions from legacy + includes/class-furniture-data.php + +Extract all furniture items from legacy liste.php into structured arrays. + +For each of the 7 rooms (Wohnzimmer, Schlafzimmer, Arbeitszimmer, Bad, Küche/Esszimmer, Kinderzimmer, Keller/Speicher/Garage): +1. Find all hidden inputs with pattern: `name="[RoomName][q{ItemName}]" value="{cbm}"` +2. Create array entry with: + - 'name' => Item name (e.g., "Sofa, Couch, je Sitz") + - 'cbm' => Float value (e.g., 0.40) + - 'montage' => true (all items in legacy have montage radio buttons) + +Preserve exact item names and order from legacy - DO NOT translate, modify, or reorder. +Total items: ~118 across all rooms (Wohnzimmer has 32 items as reference). + +Room key mapping: +- Wohnzimmer → 'wohnzimmer' +- Schlafzimmer → 'schlafzimmer' +- Arbeitszimmer → 'arbeitszimmer' +- Bad → 'bad' +- Küche/Esszimmer → 'kueche_esszimmer' +- Kinderzimmer → 'kinderzimmer' +- Keller/Speicher/Garage → 'keller' + +WHY exact preservation: Email format must match legacy exactly for office staff workflow. + + Run: `php -r "require 'includes/class-furniture-data.php'; \$rooms = Umzugsliste_Furniture_Data::get_rooms(); var_dump(count(\$rooms)); \$wz = Umzugsliste_Furniture_Data::get_furniture_items('wohnzimmer'); var_dump(count(\$wz));"` shows 7 rooms and 32 Wohnzimmer items + All 7 rooms extracted, ~118 total items, each with name/cbm/montage, exact match to legacy names and values + + + + Task 3: Extract additional work sections + includes/class-furniture-data.php + +Extract additional work sections from legacy liste.php into `get_additional_work()` method. + +Sections to extract (from PROJECT.md): +- Montage +- Schrank +- Elektriker +- Dübelarbeiten +- Packarbeiten +- Anfahrt + +These appear as separate form sections in legacy liste.php (after the 7 rooms, before Sonstiges). +Return as array with keys matching section names, each containing relevant fields/options. + +Also note: Sonstiges is a free text field - document this in the method but don't extract structured data (it's a textarea). + +WHY: Email format includes these sections after furniture inventory. + + Method returns array with 6 additional work sections, matches legacy structure + Additional work sections extracted, structured appropriately for future form rendering and email generation + + + + + +Before declaring plan complete: +- [ ] Class file has no PHP syntax errors (`php -l includes/class-furniture-data.php`) +- [ ] All 7 rooms defined with correct German names +- [ ] Wohnzimmer has 32 furniture items (spot check) +- [ ] All items have name, cbm (float), and montage (boolean) keys +- [ ] Additional work sections extracted (6 sections) +- [ ] No modifications to item names or values from legacy + + + + +- All tasks completed +- Furniture data class created following singleton pattern +- All 118+ furniture items extracted from 7 rooms +- CBM values preserved as floats +- Additional work sections extracted +- Item names and order match legacy exactly +- No PHP errors when class is loaded + + + +After completion, create `.planning/phases/02-legacy-data/02-01-SUMMARY.md`: + +# Phase 2 Plan 1: Legacy Data Extraction Summary + +**Furniture inventory extracted from legacy PHP: 118+ items across 7 rooms with exact cbm values** + +## Accomplishments + +- Created Umzugsliste_Furniture_Data class with singleton pattern +- Extracted all furniture items from legacy liste.php +- Preserved exact item names, cbm values, and room structure +- Additional work sections extracted for future form rendering + +## Files Created/Modified + +- `includes/class-furniture-data.php` - Furniture data structure class + +## Decisions Made + +- Used static arrays (not database) - matches legacy, editing is future feature +- Preserved exact legacy item names - required for email format compatibility +- Room key naming convention established (lowercase, underscores) + +## Issues Encountered + +[Document any discrepancies found in legacy data, or "None"] + +## Next Phase Readiness + +Data extraction complete. Ready for Phase 3 (Settings System) or Phase 4 (Form Rendering). +Phase 4 will consume this data to render the 7-room form structure. +