Headroom - Foundation

This commit is contained in:
2026-02-17 02:10:23 -05:00
commit 04022b7e0b
46 changed files with 10488 additions and 0 deletions

View File

@@ -0,0 +1,60 @@
## ADDED Requirements
### Requirement: Create team member
The system SHALL allow authorized users to create new team members with name, role, hourly rate, and active status.
#### Scenario: Successful team member creation
- **WHEN** a manager creates a team member with valid name "John Doe", role "Backend Developer", and hourly rate $150
- **THEN** the system creates the team member with active status set to true by default
- **AND** the system assigns a unique identifier to the team member
- **AND** the system returns the created team member details
#### Scenario: Invalid hourly rate
- **WHEN** a manager attempts to create a team member with hourly rate of $0 or negative value
- **THEN** the system rejects the request with validation error "Hourly rate must be greater than 0"
#### Scenario: Missing required fields
- **WHEN** a manager attempts to create a team member without name or role
- **THEN** the system rejects the request with validation error listing missing required fields
### Requirement: View team members
The system SHALL allow authorized users to view the list of team members with their details.
#### Scenario: View all team members
- **WHEN** a manager requests the team members list
- **THEN** the system returns all team members with name, role, hourly rate, and active status
- **AND** the list includes both active and inactive team members
#### Scenario: Filter active team members only
- **WHEN** a manager requests team members filtered by active status
- **THEN** the system returns only team members where active is true
### Requirement: Update team member
The system SHALL allow authorized users to update team member details including role, hourly rate, and active status.
#### Scenario: Successful update
- **WHEN** a manager updates a team member's hourly rate from $150 to $175
- **THEN** the system updates the team member record
- **AND** the system returns the updated team member details
#### Scenario: Deactivate team member
- **WHEN** a manager sets a team member's active status to false
- **THEN** the system marks the team member as inactive
- **AND** the system preserves all historical allocation and actuals data for the team member
#### Scenario: Cannot update non-existent team member
- **WHEN** a manager attempts to update a team member that does not exist
- **THEN** the system returns a 404 Not Found error
### Requirement: Cannot delete team member with allocations
The system SHALL prevent deletion of team members who have active allocations or logged actuals.
#### Scenario: Attempt to delete team member with allocations
- **WHEN** a manager attempts to delete a team member who has allocations in current or future months
- **THEN** the system rejects the deletion with error "Cannot delete team member with active allocations"
- **AND** the system suggests deactivating the team member instead
#### Scenario: Attempt to delete team member with actuals
- **WHEN** a manager attempts to delete a team member who has logged actuals
- **THEN** the system rejects the deletion with error "Cannot delete team member with historical data"
- **AND** the system suggests deactivating the team member instead