'datetime', 'expires_at' => 'datetime', 'assigned_interviewers' => 'array', 'proctor_logs' => 'array', 'recordings' => 'array', ]; public function creator() { return $this->belongsTo(User::class, 'created_by'); } public function warnings() { return $this->hasMany(InterviewWarning::class, 'interview_id'); } public function isExpired(): bool { return now()->greaterThan($this->expires_at); } /** * Check if the current time is within the interview timeline. */ public function isActiveTimeline(): bool { $now = now(); $start = $this->scheduled_at ?? $this->created_at; if ($now->lessThan($start)) { return false; } if ($now->greaterThan($this->expires_at)) { return false; } return !in_array($this->status, ['completed', 'expired']); } /** * Check if a specific user is assigned as an interviewer. */ public function isAssignedInterviewer($userId): bool { if (empty($this->assigned_interviewers)) { return false; } $interviewers = array_map('strval', (array) $this->assigned_interviewers); return in_array((string) $userId, $interviewers, true); } }