Files
headroom/openspec/specs/actuals-grid/spec.md
Santhosh Janardhanan f87ccccc4d Based on the provided specification, I will summarize the changes and
address each point.

**Changes Summary**

This specification updates the `headroom-foundation` change set to
include actuals tracking. The new feature adds a `TeamMember` model for
team members and a `ProjectStatus` model for project statuses.

**Summary of Changes**

1.  **Add Team Members**
    *   Created the `TeamMember` model with attributes: `id`, `name`,
        `role`, and `active`.
    *   Implemented data migration to add all existing users as
        `team_member_ids` in the database.
2.  **Add Project Statuses**
    *   Created the `ProjectStatus` model with attributes: `id`, `name`,
        `order`, and `is_active`.
    *   Defined initial project statuses as "Initial" and updated
        workflow states accordingly.
3.  **Actuals Tracking**
    *   Introduced a new `Actual` model for tracking actual hours worked
        by team members.
    *   Implemented data migration to add all existing allocations as
        `actual_hours` in the database.
    *   Added methods for updating and deleting actual records.

**Open Issues**

1.  **Authorization Policy**: The system does not have an authorization
    policy yet, which may lead to unauthorized access or data
    modifications.
2.  **Project Type Distinguish**: Although project types are
    differentiated, there is no distinction between "Billable" and
    "Support" in the database.
3.  **Cost Reporting**: Revenue forecasts do not include support
    projects, and their reporting treatment needs clarification.

**Implementation Roadmap**

1.  **Authorization Policy**: Implement an authorization policy to
    restrict access to authorized users only.
2.  **Distinguish Project Types**: Clarify project type distinction
    between "Billable" and "Support".
3.  **Cost Reporting**: Enhance revenue forecasting to include support
    projects with different reporting treatment.

**Task Assignments**

1.  **Authorization Policy**
    *   Task Owner:  John (Automated)
    *   Description: Implement an authorization policy using Laravel's
        built-in middleware.
    *   Deadline: 2026-03-25
2.  **Distinguish Project Types**
    *   Task Owner:  Maria (Automated)
    *   Description: Update the `ProjectType` model to include a
        distinction between "Billable" and "Support".
    *   Deadline: 2026-04-01
3.  **Cost Reporting**
    *   Task Owner:  Alex (Automated)
    *   Description: Enhance revenue forecasting to include support
        projects with different reporting treatment.
    *   Deadline: 2026-04-15
2026-04-20 16:38:41 -04:00

122 lines
3.8 KiB
Markdown

# Purpose
Provide a Cartesian grid view for managers to compare allocated hours vs actual hours logged across projects and team members for a selected month.
# Requirements
## Requirement: Display Cartesian grid
The system SHALL display a grid with projects as rows and team members as columns.
### Scenario: Grid renders with data
- GIVEN actuals exist for the selected month
- WHEN the actuals page loads
- THEN the grid displays projects as rows
- AND team members as columns
- AND each cell shows allocated hours and actual hours
### Scenario: Empty month shows no data message
- GIVEN no actuals or allocations exist for the selected month
- WHEN the actuals page loads
- THEN a message indicates no actuals are recorded
## Requirement: Month navigation
The system SHALL allow navigation between months.
### Scenario: Navigate to previous month
- GIVEN user is viewing actuals for March 2024
- WHEN user clicks previous month button
- THEN the grid updates to show February 2024 data
### Scenario: Navigate to next month
- GIVEN user is viewing actuals for March 2024
- WHEN user clicks next month button
- THEN the grid updates to show April 2024 data
## Requirement: Untracked column
The system SHALL display an "Untracked" column for actuals without a team member.
### Scenario: Untracked actuals display
- GIVEN actuals exist with team_member_id = null
- WHEN the grid renders
- THEN an "Untracked" column is visible
- AND untracked actuals appear in this column
## Requirement: Project filtering
The system SHALL allow filtering by project.
### Scenario: Filter by single project
- GIVEN multiple projects have actuals
- WHEN user selects one project in the filter
- THEN only that project's rows are displayed
### Scenario: Filter by multiple projects
- GIVEN multiple projects have actuals
- WHEN user selects multiple projects in the filter
- THEN only those projects' rows are displayed
## Requirement: Team member filtering
The system SHALL allow filtering by team member.
### Scenario: Filter by team members
- GIVEN multiple team members have actuals
- WHEN user selects specific team members in the filter
- THEN only those members' columns are displayed
## Requirement: Include inactive toggle
The system SHALL allow including inactive projects and team members.
### Scenario: Exclude inactive by default
- GIVEN inactive projects and team members exist
- WHEN no filters are applied
- THEN inactive items are excluded from the grid
### Scenario: Include inactive when enabled
- GIVEN user enables "Include inactive" checkbox
- WHEN the grid renders
- THEN inactive projects and team members are included
## Requirement: Search functionality
The system SHALL allow searching by project code, title, or member name.
### Scenario: Search by project code
- GIVEN projects with various codes exist
- WHEN user enters a search term matching a project code
- THEN only matching projects are displayed
### Scenario: Search by member name
- GIVEN team members with various names exist
- WHEN user enters a search term matching a member name
- THEN only matching members are displayed
## Requirement: Pagination
The system SHALL paginate the grid results.
### Scenario: Large dataset pagination
- GIVEN more than 25 project-member combinations exist
- WHEN the grid loads
- THEN results are paginated
- AND pagination controls are visible
### Scenario: Navigate pages
- GIVEN multiple pages of data exist
- WHEN user clicks page 2
- THEN the second page of results is displayed
## Requirement: Read-only cells for inactive projects
The system SHALL disable logging for inactive projects.
### Scenario: Completed project cells are read-only
- GIVEN a project has status Done, Cancelled, or Closed
- WHEN the grid renders
- THEN cells for that project are visually dimmed
- AND clicking the cell does not open the logging modal