Files
sam-manage/app/Models/Interview/InterviewSession.php

61 lines
1.4 KiB
PHP
Raw Normal View History

<?php
namespace App\Models\Interview;
use App\Traits\BelongsToTenant;
use App\Traits\ModelTrait;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;
class InterviewSession extends Model
{
use BelongsToTenant, ModelTrait, SoftDeletes;
protected $fillable = [
'tenant_id',
'interview_project_id',
'interview_category_id',
'interviewer_id',
'interviewee_name',
'interviewee_company',
'interview_date',
'status',
'session_type',
'voice_recording_id',
'total_questions',
'answered_questions',
'memo',
'completed_at',
'created_by',
'updated_by',
'deleted_by',
];
protected $casts = [
'interview_date' => 'date',
'completed_at' => 'datetime',
'total_questions' => 'integer',
'answered_questions' => 'integer',
];
public function project()
{
return $this->belongsTo(InterviewProject::class, 'interview_project_id');
}
public function category()
{
return $this->belongsTo(InterviewCategory::class, 'interview_category_id');
}
public function interviewer()
{
return $this->belongsTo(\App\Models\User::class, 'interviewer_id');
}
public function answers()
{
return $this->hasMany(InterviewAnswer::class, 'interview_session_id');
}
}