Add comprehensive API documentation for the reporting endpoint: - Request/response structure - View type inference (did/is/will) - Blank vs explicit zero semantics - Status values and error responses Related to enhanced-allocation change.
3.5 KiB
3.5 KiB
Proposal: Enhanced Allocation Fidelity
Why
The current Resource Allocation implementation diverges from intended planning behavior and creates misleading month-level signals.
Current drift:
- Monthly budget was treated as a derived display (
approved_estimate / 12) rather than explicit manager planning. - Allocation execution and planning intent are conflated in one surface.
- Visual signaling is noisier than needed for decision-making.
- Untracked allocation and partial bulk semantics are only partially implemented.
Business need:
- Managers must phase a project lifecycle estimate across months based on dependencies and customer timelines.
- Month execution must be validated against explicit month plans, not an average split.
- Management needs deterministic reporting from a strict plan -> execute chain.
What Changes
This change formalizes and aligns a strict 3-surface model (with reporting as the 4th outcome surface):
-
Projects (Lifecycle Total)
approved_estimateremains the project-level lifecycle cap.
-
Project-Month Plan (Manager Intent)
- Manager enters monthly planned hours per project in a grid.
- Monthly plans reconcile against lifecycle total (OVER/UNDER/MATCH).
- Blank planning months remain blank in UI.
-
Project-Resource Allocation (Month Execution)
- Allocation grid becomes primary editing workflow (no modal-first dependency).
- Row variance compares month allocation vs project month plan.
- Column variance compares member allocation vs member month capacity.
- Untracked (
team_member_id = null) is supported as a first-class execution path.
-
Reporting Outcome
- Reporting consumes lifecycle total + month plan + resource allocation to show did/is/will views.
Capability Changes
New / Expanded Capabilities
monthly-budget(reframed as project-month planning)allocation-indicators(minimal, edge-focused variance signaling)untracked-allocation(null team member end-to-end semantics)
Modified Capability
resource-allocation(partial bulk success, month-plan-aware variance)
Key Rules Locked by This Change
- No
approved_estimate / 12derivation for planning behavior. - Month plan reconciliation is explicit:
- sum(plan) > approved -> OVER
- sum(plan) < approved -> UNDER
- sum(plan) == approved -> MATCH
- Blank planning month is visually blank, but treated as planned
0for allocation variance. - Allocation for blank-plan months is allowed.
projects.forecasted_effortis deprecated for this workflow.- Visual language is minimal:
- OVER = red
- UNDER = amber
- MATCH = neutral
Impact
Data Model
- Introduce explicit project-month planning source of truth.
- Stop using
projects.forecasted_effortin this workflow path.
API Contract
- Add/adjust project-month plan endpoints and payloads.
- Ensure allocation endpoints provide enough context for row/column variance.
- Keep partial bulk response contract explicit (created/failed/summary).
Frontend
- Add project-month plan grid surface.
- Refactor allocation matrix to grid-first editing and edge variance indicators.
- Keep status placement low-noise and decision-oriented.
Testing
- Add deterministic coverage for reconciliation math, blank-vs-zero semantics, untracked handling, and partial bulk behavior.
- Require mapped tests for every requirement scenario before task closure.
Non-Goals
- Real-time collaboration/websockets in this change.
- Notification systems.
- Export workflows.
- UI polish iterations beyond required planning fidelity.