Complete tasks 4.1-4.2: Page management service and HTTP endpoints

- Implemented PageService with full CRUD operations
- Added GetPages, CreatePage, UpdatePage, DeletePage, ReorderPages methods
- Cascade deletion of widgets when page is deleted
- Prevention of last page deletion
- Created page HTTP endpoints (GET, POST, PUT, DELETE, reorder)
- HTMX-friendly HTML fragment responses
- Comprehensive unit tests for service and handlers
- Updated dashboard to use PageService and create default pages
This commit is contained in:
2026-02-19 00:08:05 -05:00
parent 9f07b0c6f9
commit 299ac03939
16 changed files with 1572 additions and 31 deletions

View File

@@ -110,7 +110,7 @@ Each task references specific requirements from the requirements document and in
- **Validates: Requirements 8.2, 8.3, 8.4, 8.5**
- [ ] 4. Implement page management
- [~] 4.1 Create PageService with all CRUD operations
- [x] 4.1 Create PageService with all CRUD operations
- Implement GetPages method (query by user_id, sort by order)
- Implement CreatePage method with default "Home" page for new users
- Implement UpdatePage method (name and order updates)
@@ -119,7 +119,7 @@ Each task references specific requirements from the requirements document and in
- Add validation: prevent deletion of last page
- _Requirements: 2.1, 2.2, 2.3, 2.5, 2.6, 2.7, 2.8_
- [~] 4.2 Create page HTTP endpoints
- [x] 4.2 Create page HTTP endpoints
- Implement GET /dashboard (full page with page tabs)
- Implement GET /pages/:id (returns widget grid HTML fragment)
- Implement POST /pages (create page, returns updated tabs HTML)