feat: shift assignment workflow with claim, approve, reject, cancel, and bulk approve
Implements the complete ShiftAssignment lifecycle: - ShiftAssignmentStatus enum with allowed transitions - ShiftAssignmentService with claim/assign/approve/reject/cancel/bulkApprove - ShiftAssignmentController with event-scoped endpoints - ShiftAssignmentPolicy (organizer + volunteer self-cancel) - VolunteerAvailability model, controller, and sync endpoint - Refactored ShiftController to delegate to service layer - 31 workflow tests covering all paths and multi-tenancy Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -4,6 +4,7 @@ declare(strict_types=1);
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use App\Enums\ShiftAssignmentStatus;
|
||||
use Illuminate\Database\Eloquent\Builder;
|
||||
use Illuminate\Database\Eloquent\Casts\Attribute;
|
||||
use Illuminate\Database\Eloquent\Concerns\HasUlids;
|
||||
@@ -99,7 +100,7 @@ final class Shift extends Model
|
||||
return (int) $this->attributes['filled_slots'];
|
||||
}
|
||||
|
||||
return $this->shiftAssignments()->where('status', 'approved')->count();
|
||||
return $this->shiftAssignments()->where('status', ShiftAssignmentStatus::APPROVED)->count();
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user