feat(allocation): implement resource allocation feature

- Add AllocationController with CRUD + bulk endpoints
- Add AllocationValidationService for capacity/estimate validation
- Add AllocationMatrixService for optimized matrix queries
- Add AllocationPolicy for authorization
- Add AllocationResource for API responses
- Add frontend allocationService and matrix UI
- Add E2E tests for allocation matrix (20 tests)
- Add unit tests for validation service and policies
- Fix month format conversion (YYYY-MM to YYYY-MM-01)
This commit is contained in:
2026-02-25 16:28:47 -05:00
parent fedfc21425
commit 3324c4f156
35 changed files with 3337 additions and 67 deletions

View File

@@ -287,6 +287,23 @@ class CapacityService
return $entry;
}
public function batchUpsertAvailability(array $updates, string $month): int
{
$count = 0;
foreach ($updates as $update) {
TeamMemberAvailability::updateOrCreate(
['team_member_id' => $update['team_member_id'], 'date' => $update['date']],
['availability' => $update['availability']]
);
$count++;
}
$this->forgetCapacityCacheForMonth($month);
return $count;
}
/**
* Create a CarbonPeriod for the given month.
*/