feat(project): Complete Project Lifecycle capability with full TDD workflow

- 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
This commit is contained in:
2026-02-19 02:43:05 -05:00
parent 8f70e81d29
commit 8ed56c9f7c
19 changed files with 5126 additions and 173 deletions

View File

@@ -110,11 +110,15 @@ test.describe('Team Member Management - Phase 1 Tests (GREEN)', () => {
// 2.1.1 E2E test: Create team member with valid data
test('create team member with valid data', async ({ page }) => {
// Wait for page to be ready (loading state to complete)
await expect(page.locator('.loading-state')).not.toBeVisible({ timeout: 15000 });
await expect(page.locator('h1', { hasText: 'Team Members' })).toBeVisible({ timeout: 10000 });
// Click Add Member button
await page.getByRole('button', { name: /Add Member/i }).click();
// Wait for modal to appear
await expect(page.locator('.modal-box')).toBeVisible();
await expect(page.locator('.modal-box')).toBeVisible({ timeout: 10000 });
// Fill in the form using IDs
await page.fill('#name', 'Test User E2E');
@@ -134,9 +138,13 @@ test.describe('Team Member Management - Phase 1 Tests (GREEN)', () => {
// 2.1.2 E2E test: Reject team member with invalid hourly rate
test('reject team member with invalid hourly rate', async ({ page }) => {
// Wait for page to be ready (loading state to complete)
await expect(page.locator('.loading-state')).not.toBeVisible({ timeout: 15000 });
await expect(page.locator('h1', { hasText: 'Team Members' })).toBeVisible({ timeout: 10000 });
// Click Add Member button
await page.getByRole('button', { name: /Add Member/i }).click();
await expect(page.locator('.modal-box')).toBeVisible();
await expect(page.locator('.modal-box')).toBeVisible({ timeout: 10000 });
// Fill in the form with invalid hourly rate
await page.fill('#name', 'Jane Smith');
@@ -153,9 +161,13 @@ test.describe('Team Member Management - Phase 1 Tests (GREEN)', () => {
// 2.1.3 E2E test: Reject team member with missing required fields
test('reject team member with missing required fields', async ({ page }) => {
// Wait for page to be ready (loading state to complete)
await expect(page.locator('.loading-state')).not.toBeVisible({ timeout: 15000 });
await expect(page.locator('h1', { hasText: 'Team Members' })).toBeVisible({ timeout: 10000 });
// Click Add Member button
await page.getByRole('button', { name: /Add Member/i }).click();
await expect(page.locator('.modal-box')).toBeVisible();
await expect(page.locator('.modal-box')).toBeVisible({ timeout: 10000 });
// Submit the form without filling required fields (HTML5 validation will prevent)
await page.getByRole('button', { name: /Create/i }).click();