Merge remote-tracking branch 'origin/develop' into develop

This commit is contained in:
2026-02-06 22:16:36 +09:00
10 changed files with 408 additions and 0 deletions

View File

@@ -0,0 +1,40 @@
<?php
namespace App\Models\Interview;
use App\Traits\BelongsToTenant;
use Illuminate\Database\Eloquent\Model;
class InterviewAnswer extends Model
{
use BelongsToTenant;
protected $fillable = [
'tenant_id',
'interview_session_id',
'interview_question_id',
'interview_template_id',
'is_checked',
'answer_text',
'memo',
];
protected $casts = [
'is_checked' => 'boolean',
];
public function session()
{
return $this->belongsTo(InterviewSession::class, 'interview_session_id');
}
public function question()
{
return $this->belongsTo(InterviewQuestion::class, 'interview_question_id');
}
public function template()
{
return $this->belongsTo(InterviewTemplate::class, 'interview_template_id');
}
}

View File

@@ -0,0 +1,44 @@
<?php
namespace App\Models\Interview;
use App\Traits\Auditable;
use App\Traits\BelongsToTenant;
use App\Traits\ModelTrait;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;
class InterviewCategory extends Model
{
use Auditable, BelongsToTenant, ModelTrait, SoftDeletes;
protected $fillable = [
'tenant_id',
'name',
'description',
'sort_order',
'is_active',
'created_by',
'updated_by',
'deleted_by',
];
protected $casts = [
'is_active' => 'boolean',
'sort_order' => 'integer',
];
protected $hidden = [
'deleted_at',
];
public function templates()
{
return $this->hasMany(InterviewTemplate::class, 'interview_category_id');
}
public function sessions()
{
return $this->hasMany(InterviewSession::class, 'interview_category_id');
}
}

View File

@@ -0,0 +1,44 @@
<?php
namespace App\Models\Interview;
use App\Traits\Auditable;
use App\Traits\BelongsToTenant;
use App\Traits\ModelTrait;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;
class InterviewQuestion extends Model
{
use Auditable, BelongsToTenant, ModelTrait, SoftDeletes;
protected $fillable = [
'tenant_id',
'interview_template_id',
'question_text',
'question_type',
'options',
'is_required',
'sort_order',
'is_active',
'created_by',
'updated_by',
'deleted_by',
];
protected $casts = [
'options' => 'array',
'is_required' => 'boolean',
'is_active' => 'boolean',
'sort_order' => 'integer',
];
protected $hidden = [
'deleted_at',
];
public function template()
{
return $this->belongsTo(InterviewTemplate::class, 'interview_template_id');
}
}

View File

@@ -0,0 +1,57 @@
<?php
namespace App\Models\Interview;
use App\Traits\Auditable;
use App\Traits\BelongsToTenant;
use App\Traits\ModelTrait;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;
class InterviewSession extends Model
{
use Auditable, BelongsToTenant, ModelTrait, SoftDeletes;
protected $fillable = [
'tenant_id',
'interview_category_id',
'interviewer_id',
'interviewee_name',
'interviewee_company',
'interview_date',
'status',
'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',
];
protected $hidden = [
'deleted_at',
];
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');
}
}

View File

@@ -0,0 +1,45 @@
<?php
namespace App\Models\Interview;
use App\Traits\Auditable;
use App\Traits\BelongsToTenant;
use App\Traits\ModelTrait;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;
class InterviewTemplate extends Model
{
use Auditable, BelongsToTenant, ModelTrait, SoftDeletes;
protected $fillable = [
'tenant_id',
'interview_category_id',
'name',
'description',
'sort_order',
'is_active',
'created_by',
'updated_by',
'deleted_by',
];
protected $casts = [
'is_active' => 'boolean',
'sort_order' => 'integer',
];
protected $hidden = [
'deleted_at',
];
public function category()
{
return $this->belongsTo(InterviewCategory::class, 'interview_category_id');
}
public function questions()
{
return $this->hasMany(InterviewQuestion::class, 'interview_template_id');
}
}