## ADDED Requirements ### Requirement: Log hours worked The system SHALL allow team members to log actual hours worked per project per month. #### Scenario: Log hours for current month - **WHEN** a team member logs 35 hours worked on "Project X" for February 2026 - **THEN** the system creates an actuals record - **AND** the system associates the hours with the team member, project, and month #### Scenario: Cannot log negative hours - **WHEN** attempting to log -5 hours - **THEN** the system rejects the request with validation error "Hours logged must be greater than or equal to 0" #### Scenario: Cannot log hours for future months - **WHEN** attempting to log hours for a month that hasn't started yet - **THEN** the system rejects the request with validation error "Cannot log hours for future months" ### Requirement: Update logged hours (incremental) The system SHALL allow team members to update previously logged hours using incremental updates. #### Scenario: Incremental weekly updates - **WHEN** a team member logs 10 hours in week 1 of February - **AND** logs an additional 8 hours in week 2 of February - **AND** the system updates the total to 18 hours for February - **THEN** the system accumulates the hours for the monthly aggregate - **AND** the system preserves all notes from each update ### Requirement: View actuals summary with variance The system SHALL display actual hours worked in a matrix view showing allocated, actual, and variance data. #### Scenario: View monthly actuals matrix - **WHEN** a manager views actuals for February 2026 - **THEN** the system displays projects as rows and team members as columns - **AND** each cell shows: - **Allocated hours** (from allocation records) - **Actual hours** (from actuals records) - **Variance %** = ((Actual - Allocated) / Allocated) × 100 - **Variance indicator**: GREEN (≤5%), YELLOW (5-20%), RED (>20%) #### Scenario: Show variance indicators - **WHEN** viewing the actuals matrix - **THEN** cells are color-coded based on variance: - GREEN: Within ±5% of allocation (on track) - YELLOW: 5-20% variance (attention needed) - RED: >20% variance (significant deviation) ### Requirement: Cannot log hours to inactive projects The system SHALL prevent logging hours to projects in "Done" or "Cancelled" status (configurable via global setting). #### Scenario: Attempt to log hours to done project - **WHEN** attempting to log hours for a project with status "Done" - **AND** the global system configuration `allow_actuals_on_inactive_projects` is false - **THEN** the system rejects the request with error "Cannot log hours to completed projects" #### Scenario: Allow logging to done project if configured - **WHEN** the global configuration `allow_actuals_on_inactive_projects` is true - **AND** a team member logs hours to a "Done" project - **THEN** the system accepts the hours (for edge cases where work continues after project closure) ### Requirement: Actuals data entry is manual The system SHALL support manual entry of actual hours without integration to time-tracking tools (MVP). #### Scenario: Manual monthly entry - **WHEN** a team member enters actual hours worked via the web interface - **THEN** the system accepts the input without requiring integration with external time-tracking systems #### Scenario: No automated time import - **WHEN** viewing actuals entry interface - **THEN** the system does not provide options to import from Jira, Harvest, Toggl, or other time-tracking tools (deferred to Phase 2) ### Requirement: Track actuals notes The system SHALL allow optional notes when logging hours. #### Scenario: Log hours with notes - **WHEN** a team member logs 40 hours with notes "Focused on API development and bug fixes" - **THEN** the system stores the notes alongside the hours logged #### Scenario: View notes in matrix - **WHEN** viewing the actuals matrix - **THEN** clicking on a cell shows the history of logged hours with timestamps and notes