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>
26 lines
628 B
PHP
26 lines
628 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace Database\Factories;
|
|
|
|
use App\Models\Person;
|
|
use App\Models\TimeSlot;
|
|
use App\Models\VolunteerAvailability;
|
|
use Illuminate\Database\Eloquent\Factories\Factory;
|
|
|
|
/** @extends Factory<VolunteerAvailability> */
|
|
final class VolunteerAvailabilityFactory extends Factory
|
|
{
|
|
/** @return array<string, mixed> */
|
|
public function definition(): array
|
|
{
|
|
return [
|
|
'person_id' => Person::factory(),
|
|
'time_slot_id' => TimeSlot::factory(),
|
|
'preference_level' => fake()->numberBetween(1, 5),
|
|
'submitted_at' => now(),
|
|
];
|
|
}
|
|
}
|