feat(backend): enhance allocation and project management

Update controllers and services for allocation fidelity:
- AllocationController: variance data in responses, bulk operations
- ProjectController: include plan data in responses
- ProjectMonthPlanController: planning grid API
- AllocationMatrixService: support untracked allocations
- ProjectResource/TeamMemberResource: include reconciliation data

Improved test coverage for allocation flows.
This commit is contained in:
2026-03-08 18:22:53 -04:00
parent 9b38e28117
commit 9b0f42fdf5
14 changed files with 414 additions and 376 deletions

View File

@@ -7,6 +7,7 @@ use App\Models\Project;
use App\Models\Role;
use App\Models\TeamMember;
use App\Services\AllocationMatrixService;
use App\Services\VarianceCalculator;
use Illuminate\Foundation\Testing\RefreshDatabase;
use Tests\TestCase;
@@ -24,11 +25,11 @@ class AllocationCacheInvalidationTest extends TestCase
Allocation::factory()->create([
'project_id' => $project->id,
'team_member_id' => $teamMember->id,
'month' => '2026-02',
'month' => '2026-02-01',
'allocated_hours' => 40,
]);
$matrixService = new AllocationMatrixService;
$matrixService = new AllocationMatrixService(new VarianceCalculator);
$result = $matrixService->getMatrix('2026-02');
$this->assertArrayHasKey('allocations', $result);