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:
@@ -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.
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user