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:
@@ -15,10 +15,24 @@ final class ShiftAssignmentResource extends JsonResource
|
||||
'id' => $this->id,
|
||||
'shift_id' => $this->shift_id,
|
||||
'person_id' => $this->person_id,
|
||||
'status' => $this->status,
|
||||
'time_slot_id' => $this->time_slot_id,
|
||||
'status' => $this->status->value,
|
||||
'auto_approved' => $this->auto_approved,
|
||||
'assigned_by' => $this->assigned_by,
|
||||
'assigned_at' => $this->assigned_at?->toIso8601String(),
|
||||
'approved_by' => $this->approved_by,
|
||||
'approved_at' => $this->approved_at?->toIso8601String(),
|
||||
'rejection_reason' => $this->rejection_reason,
|
||||
'hours_expected' => $this->hours_expected,
|
||||
'hours_completed' => $this->hours_completed,
|
||||
'checked_in_at' => $this->checked_in_at?->toIso8601String(),
|
||||
'checked_out_at' => $this->checked_out_at?->toIso8601String(),
|
||||
'is_cancellable' => $this->isCancellable(),
|
||||
'is_approvable' => $this->isApprovable(),
|
||||
'created_at' => $this->created_at?->toIso8601String(),
|
||||
|
||||
'person' => new PersonResource($this->whenLoaded('person')),
|
||||
'shift' => new ShiftResource($this->whenLoaded('shift')),
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user