62 lines
1.3 KiB
PHP
62 lines
1.3 KiB
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
|
use Illuminate\Database\Eloquent\Model;
|
|
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
|
|
|
class SubmissionCorrectionRequest extends Model
|
|
{
|
|
use HasFactory;
|
|
|
|
public const STATUSES = [
|
|
'terbuka' => 'Terbuka',
|
|
'dijawab' => 'Dijawab',
|
|
'selesai' => 'Selesai',
|
|
];
|
|
|
|
protected $fillable = [
|
|
'submission_id',
|
|
'checklist_item_id',
|
|
'page_reference',
|
|
'location',
|
|
'description',
|
|
'status',
|
|
'consultant_response',
|
|
'responded_at',
|
|
'responded_by',
|
|
'created_by',
|
|
'resolved_at',
|
|
'resolved_by',
|
|
];
|
|
|
|
protected function casts(): array
|
|
{
|
|
return [
|
|
'responded_at' => 'datetime',
|
|
'resolved_at' => 'datetime',
|
|
];
|
|
}
|
|
|
|
public function submission(): BelongsTo
|
|
{
|
|
return $this->belongsTo(Submission::class);
|
|
}
|
|
|
|
public function item(): BelongsTo
|
|
{
|
|
return $this->belongsTo(ChecklistItem::class, 'checklist_item_id');
|
|
}
|
|
|
|
public function createdBy(): BelongsTo
|
|
{
|
|
return $this->belongsTo(User::class, 'created_by');
|
|
}
|
|
|
|
public function respondedBy(): BelongsTo
|
|
{
|
|
return $this->belongsTo(User::class, 'responded_by');
|
|
}
|
|
}
|