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:
@@ -21,6 +21,18 @@ test('team member resource wraps data and includes role when loaded', function (
|
||||
expect($payload['data']['role']['id'])->toBe($role->id);
|
||||
});
|
||||
|
||||
test('team member resource includes scalar role_id', function () {
|
||||
$role = Role::factory()->create();
|
||||
$teamMember = TeamMember::factory()->create(['role_id' => $role->id]);
|
||||
$teamMember->load('role');
|
||||
|
||||
$response = (new TeamMemberResource($teamMember))->toResponse(Request::create('/'));
|
||||
$payload = $response->getData(true);
|
||||
|
||||
expect($payload['data'])->toHaveKey('role_id');
|
||||
expect($payload['data']['role_id'])->toBe($teamMember->role_id);
|
||||
});
|
||||
|
||||
test('team member resource collection keeps data wrapper', function () {
|
||||
$role = Role::factory()->create();
|
||||
$teamMembers = TeamMember::factory()->count(2)->create(['role_id' => $role->id]);
|
||||
|
||||
Reference in New Issue
Block a user