Skip to content

Conversation

@ogghst
Copy link
Owner

@ogghst ogghst commented Nov 4, 2025

completion of sprint 2 as per project plan

ogghst and others added 30 commits November 1, 2025 08:50
…ove outdated technology stack selection document.
…d using FastAPI template with Docker Compose, dependency management, CI/CD workflows, and comprehensive documentation. Updated project status to reflect increased overall completion to 13.7%.
…s, WBEs, and Cost Elements. Implemented API endpoints, data models, and tests. Introduced template import functionality for bulk project creation. Updated documentation and sample JSON for template usage.
- Regenerate OpenAPI client with Projects, WBEs, and Cost Elements endpoints
- Create Projects list route with pagination
- Add Projects link to navigation menu
- Auto-generate route tree with new route
- Create projects/$id route showing project details and WBEs table
- Create projects/$id/wbes/$wbeId route showing WBE details and Cost Elements table
- Add pagination to all nested tables
- Update route tree with new dynamic routes
- Make project rows clickable to navigate to detail view
- Make WBE rows clickable to navigate to WBE detail with Cost Elements
- Add hover effects to table rows
- Display breadcrumb trail: Projects > Project Name > WBE Name
- Make breadcrumb elements clickable to navigate back
- Use chevron separators for visual clarity
…search parameters for pagination. This enhances navigation consistency and improves user experience by ensuring users return to the first page of the project list.
… streamline the application. This includes the deletion of the items route, CRUD operations, and associated schemas, enhancing code maintainability and reducing complexity.
…stem

BREAKING CHANGE: User model now uses role enum instead of is_superuser boolean

Changes:
- Add UserRole enum with 5 roles (admin, project_manager, department_manager, controller, executive_viewer)
- Add role, department, created_at, updated_at fields to User model
- Remove is_superuser field from User model
- Update all API routes and dependencies to use role-based checks
- Create database migration to migrate existing data:
  - is_superuser=True → role='admin'
  - is_superuser=False → role='controller'
- Update all frontend components to use role field
- Regenerate frontend client types
- Update all tests to use role instead of is_superuser

Migration: 2bf8174fc249
Tests: All passing (25/25 user tests, 11/11 CRUD tests)
Frontend: Components updated, client regenerated
…ntation

- Updated last modified date to 2025-11-02
- Adjusted overall progress to 15.7% complete
- Marked E1-004 Project Creation Interface as complete, including a modal form with all required fields and validation
- Updated task completion metrics in project status documentation
- Added AddProject component for creating new projects with necessary fields and validation
- Integrated AddProject component into the Projects layout
- Updated ACT_1_retrospective.md to include actionable recommendations for future sessions.
- Added a new section in project_status.md to document key process improvements and debugging workflows from recent development sessions.
- Clarified session details and improved organization of lessons learned for better reference.
…ments

- Updated project detail and projects layout to integrate Outlet for nested routes.
- Improved navigation by ensuring correct parameters are passed for project and WBE detail routes.
- Added AddWBE component to facilitate the creation of Work Breakdown Elements directly from the project detail view.
- Enhanced user experience by conditionally rendering project management components based on the current route.
- Add full CRUD operations for projects, WBEs, and cost elements
- Implement enhanced DataTable component with column resizing, visibility, and filtering
- Add DeleteProject, DeleteWBE, DeleteCostElement components
- Add EditProject, EditWBE, EditCostElement components with form validation
- Implement useTablePreferences hook for table state management
- Update backend routes to support full CRUD operations
- Add comprehensive tests for CRUD endpoints
- Remove outdated completion status documents
- Update documentation with retrospective notes
Enhanced Sprint 2 details with specific implementation steps for budget allocation, revenue reconciliation, and time-phased planning. Clarified user interactions and CRUD operations for cost elements.
Updated task descriptions for Epic 2 to enhance clarity and detail on budget and revenue management functionalities.
- Create script to transform quotation JSON to project template format
- Map categories to WBEs and items' cost fields to cost elements
- Generate project_template_from_quotation.json from real quotation data
- Support mapping of cost fields (utm_robot, ute, sw_pc, etc.) to departments
- Add cost element schedules API routes and endpoints
- Add tests for cost element schedules functionality
- Update cost elements API routes and tests
- Add revenue plan validation hook for frontend
- Update cost element components (AddCostElement, EditCostElement)
- Update project documentation and status
- Add analysis and planning documents for cost element schedules
- Add _seed_project_from_template() function to create projects from JSON template
- Update _seed_cost_element_types() to support hardcoded UUIDs from JSON
- Add missing utm_layout cost element type to seed file
- Integrate project seeding into init_db() initialization flow
- Add comprehensive tests for project seeding including idempotency
- Add test for hardcoded UUID verification in cost element types
- Add integration test for all seeds working together

The function:
- Resolves placeholder project_manager_id to FIRST_SUPERUSER
- Validates cost_element_type_id references exist
- Creates project with WBEs and cost elements in single transaction
- Supports idempotency: updates existing projects by project_code
- Handles missing files gracefully
- Add backend validation function validate_revenue_allocation_against_project_limit()
  - Validates sum of WBE revenue_allocation ≤ project contract_value
  - Integrated into create_wbe() and update_wbe() endpoints
  - Follows same pattern as E2-001 cost element validation

- Fix database seeding issue
  - Delete BudgetAllocation records before CostElement deletion
  - Prevents foreign key constraint violations during seeding

- Add frontend validation hook useRevenueAllocationValidation()
  - Real-time validation against project contract value
  - Fetches project and all WBEs for validation
  - Returns validation result with totals and remaining budget

- Integrate validation into EditWBE component
  - Real-time validation on revenue_allocation field blur
  - Visual feedback showing total/limit/remaining budget
  - Prevents form submission when validation fails
  - Consistent UX matching EditCostElement pattern

- Add test coverage
  - test_create_wbe_exceeds_project_contract_value()
  - All existing WBE tests continue to pass

- Add high-level analysis document
  - docs/analysis/e2-002_revenue_allocation_ui_analysis.md
  - Documents patterns, approaches, and architectural impact

Completes E2-002: Revenue Allocation UI for Cost Elements (backend validation)
- Changed file permissions for multiple scripts in the 'scripts' directory to make them executable.
- Ensures proper execution of build, deploy, and testing scripts in the project.
- Backend: Add budget summary aggregation endpoints (project & WBE level)
  - GET /api/v1/budget-summary/project/{project_id}
  - GET /api/v1/budget-summary/wbe/{wbe_id}
  - Aggregates revenue_limit, total_revenue_allocated, total_budget_bac, total_revenue_plan
  - Computed fields: remaining_revenue, revenue_utilization_percent
  - 6 tests passing (3 project + 3 WBE including edge cases)

- Frontend: BudgetSummary component with react-chartjs-2 visualization
  - Doughnut chart for revenue utilization (allocated vs remaining)
  - Bar chart for budget vs revenue comparison
  - 4 summary cards: Revenue Limit, Total Allocated, Total Budget BAC, Total Revenue Plan
  - Color-coded utilization indicators (green/yellow/red)
  - Responsive grid layout

- Integration: Added to ProjectDetail and WBEDetail pages
  - Displays above WBEs/Cost Elements tables

- E2-002: Added missing WBE update validation tests
  - test_update_wbe_exceeds_project_contract_value
  - test_update_wbe_within_project_contract_value
  - All 14 WBE tests passing

- Dependencies: Added chart.js and react-chartjs-2
- Project status: Marked E2-002, E2-004 (skipped), E2-005 (skipped), E2-006 complete
- Sprint 2 status: Complete (4/6 tasks, 2 skipped)
- Move plan files from .cursor/plans/ to docs/plans/ for better organization
- Add project_template_README.md
- Add budget_timeline model and API endpoints
- Add budget timeline tests
- Update frontend dependencies and add utility functions
- Add vitest configuration for frontend testing
- Complete e2-005 time-phased budget planning plan document
- Fix linting issues: unused variable and parameter assignment
- Update biome schema version to match CLI version
Complete implementation of time-phased budget visualization feature:

Backend:
- Add /api/v1/projects/{project_id}/cost-elements-with-schedules endpoint
- Support filtering by WBE IDs, cost element IDs, and cost element type IDs
- Add CostElementWithSchedulePublic response model
- Comprehensive test coverage for filtering scenarios

Frontend Utilities:
- Progression calculations: linear, gaussian, logarithmic
- Time series generation: daily, weekly, monthly granularity
- Timeline aggregation for multiple cost elements
- Full unit test coverage for all utilities

Frontend Components:
- BudgetTimelineFilter: Context-aware multi-select filter component
  - Supports project, WBE, cost-element, and standalone contexts
  - Quick filters: Select All, All in Project/WBE, All of Selected Types
  - Filter validation and empty state handling
- BudgetTimeline: Chart visualization component
  - Aggregated and multi-line view modes
  - Chart.js integration with time scale
  - Handles missing schedules and invalid data gracefully

Integration:
- Dedicated timeline page: /projects/:id/budget-timeline
- Project detail page: Embedded timeline section
- WBE detail page: Embedded timeline with pre-selected WBE
- Cost element edit dialog: Timeline visualization section

Validation & Error Handling:
- Schedule date validation (end >= start, valid dates)
- Budget validation (budget_bac >= 0)
- Empty state handling for all scenarios
- Filter selection validation
- Graceful handling of invalid/missing data

Dependencies:
- Add chartjs-adapter-date-fns for time scale support
- Configure Vitest for frontend testing
- Add date-fns for date manipulation
- Revised overall progress to reflect completion of E2-005 (Time-Phased Budget Planning).
- Updated status to indicate all Sprint 2 tasks (E2-001, E2-002, E2-003, E2-005, E2-006) are complete, with E2-004 skipped for later implementation.
- Added recent updates highlighting the completion of E2-005 and its integration into various project components.
- Convert project detail page to tabbed layout with 4 tabs:
  * Project Information (placeholder)
  * Work Breakdown Elements (default)
  * Budget Summary
  * Budget Timeline
- Convert WBE detail page to tabbed layout with 4 tabs:
  * WBE Information (placeholder)
  * Cost Elements (default)
  * Budget Summary
  * Budget Timeline
- Tab selection persists via URL search params
- Budget timeline filters persist when switching tabs
- Remove budget timeline section from cost element edit form
- Add analysis document for tabbed layout refactoring
@ogghst ogghst merged commit d4b4d00 into main Nov 4, 2025
5 of 10 checks passed
@ogghst ogghst deleted the sprint2-budget branch November 4, 2025 14:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants