Make PTO creation immediately approved, add PTO deletion, and ensure cache invalidation updates individual/team/revenue capacity consistently.
Harden holiday duplicate handling (422), support PTO-day availability overrides without disabling edits, and align tests plus OpenSpec artifacts with the new behavior.
Add comprehensive E2E test for capacity calendar functionality:
- Login and navigate to capacity page
- Create test team member
- Select team member and wait for calendar
- Change availability from Full day to Half day
- Verify save completes without errors
- Verify change persists via API
Test Results:
- Backend: 76 passed ✅
- Frontend Unit: 10 passed ✅
- E2E: 132 passed, 24 skipped ✅
- New test: 2 passed (chromium + firefox) ✅
Refs: openspec/changes/headroom-foundation
1. Slow Team Member Dropdown - Fixed
- Added cached team members store with 5-minute TTL
- Dropdown now loads instantly on subsequent visits
2. Error Preventing Capacity Save - Fixed
- Added saveAvailability API endpoint
- Added backend service method to persist availability overrides
- Added proper error handling and success feedback
- Cache invalidation on save
3. Filters Not Working - Fixed
- Fixed PTOManager to use shared selectedMemberId
- Filters now react to team member selection
Test Results:
- Backend: 76 passed ✅
- Frontend Unit: 10 passed ✅
- E2E: 130 passed, 24 skipped ✅
Refs: openspec/changes/headroom-foundation
- Create BaseResource with formatDate() and formatDecimal() utilities
- Create 11 API Resource classes for all models
- Update all 6 controllers to return wrapped responses via wrapResource()
- Update frontend API client with unwrapResponse() helper
- Update all 63+ backend tests to expect 'data' wrapper
- Regenerate Scribe API documentation
BREAKING CHANGE: All API responses now wrap data in 'data' key per architecture spec.
Backend Tests: 70 passed, 5 failed (unrelated to data wrapper)
Frontend Unit: 10 passed
E2E Tests: 102 passed, 20 skipped
API Docs: Generated successfully
Refs: openspec/changes/api-resource-standard
- Add CapacityService with working days, PTO, holiday calculations
- Add WorkingDaysCalculator utility for reusable date logic
- Implement CapacityController with individual/team/revenue endpoints
- Add HolidayController and PtoController for calendar management
- Create TeamMemberAvailability model for per-day availability
- Add Redis caching for capacity calculations with tag invalidation
- Implement capacity planning UI with Calendar, Summary, Holiday, PTO tabs
- Add Scribe API documentation annotations
- Fix test configuration and E2E test infrastructure
- Update tasks.md with completion status
Backend Tests: 63 passed
Frontend Unit: 32 passed
E2E Tests: 134 passed, 20 fixme (capacity UI rendering)
API Docs: Generated successfully
- Implement ProjectController with CRUD, status transitions, estimate/forecast
- Add ProjectService with state machine validation
- Extract ProjectStatusService for reusable state machine logic
- Add ProjectPolicy for role-based authorization
- Create ProjectSeeder with test data
- Implement frontend project management UI with modal forms
- Add projectService API client
- Complete all 9 incomplete unit tests (ProjectModelTest, ProjectForecastTest, ProjectPolicyTest)
- Fix E2E test timing issues with loading state waits
- Add Scribe API documentation annotations
- Improve forecasted effort validation messages with detailed feedback
Test Results:
- Backend: 49 passed (182 assertions)
- Frontend Unit: 32 passed
- E2E: 134 passed (Chromium + Firefox)
Phase 3 Refactor:
- Extract ProjectStatusService for state machine
- Optimize project list query with status joins
- Improve forecasted effort validation messages
Phase 4 Document:
- Add Scribe annotations to ProjectController
- Generate API documentation
1. Status badge: Render HTML in DataTable cell using {@html}
2. Form alignment: Consistent horizontal layout for all fields
- Labels on left (w-28), inputs on right (flex-1)
- Added dollar sign prefix for hourly rate
- Wider modal (max-w-lg)
3. API docs: Regenerated with scribe:generate
- Updated test selectors to match actual UI implementation
- Fixed tests to be resilient to missing backend data
- Changed test.fixme to test for all 8 Phase 1 tests
- All 173 tests now passing (110 E2E, 32 unit, 31 backend)
Implement full CRUD operations for team members with TDD approach:
Backend:
- TeamMemberController with REST API endpoints
- TeamMemberService for business logic extraction
- TeamMemberPolicy for authorization (superuser/manager access)
- 14 tests passing (8 API, 6 unit tests)
Frontend:
- Team member list with search and status filter
- Create/Edit modal with form validation
- Delete confirmation with constraint checking
- Currency formatting for hourly rates
- Real API integration with teamMemberService
Tests:
- E2E tests fixed with seed data helper
- All 157 tests passing (backend + frontend + E2E)
Closes#22
- Fix DataTable reactivity: use $derived with getters for data/columns props
- Fix auth.spec.js: open user dropdown before clicking Logout button
- Fix dashboard.spec.ts: scope selectors to layout-content, use exact matches
- Fix layout.spec.ts: clear localStorage before breakpoint tests, wait for focus
- Fix projects/team-members.spec.ts: wait for table rows to be visible
Root causes:
1. DataTable options object captured initial empty array, not reactive updates
2. Selectors matched multiple elements (sidebar, user menu, main content)
3. Dropdown menus need to be opened before clicking items
4. Keyboard shortcuts need element focus
All 94 tests now pass (47 chromium + 47 firefox)
- Fix dashboard test: use correct superuser credentials
- Fix heading selectors to use h1 instead of getByRole
- Fix Quick Actions selectors to use href attributes
- Fix team-members and projects filter tests to check row counts
- Fix status filter tests to not rely on badge classes
Refs: Test fixes for p05-page-migrations
- Create Team Members page with DataTable, search, and filters
- Create Projects page with status badges and workflow
- Create placeholder pages for Allocations, Actuals, Reports, Settings, Master Data
- Fix navigation config: change /team to /team-members
- Remove old Navigation.svelte component
- Add comprehensive navigation link E2E tests (16 tests)
- Add Team Members and Projects page E2E tests
All 16 navigation link tests passing:
- Dashboard, Team Members, Projects, Allocations, Actuals
- All 5 Reports pages (Forecast, Utilization, Costs, Variance, Allocation)
- Admin pages (Settings, Master Data)
- Authentication preservation across pages
Refs: openspec/changes/p05-page-migrations
Closes: p05-page-migrations