first commit
This commit is contained in:
61
app/Models/SubmissionCorrectionRequest.php
Normal file
61
app/Models/SubmissionCorrectionRequest.php
Normal file
@@ -0,0 +1,61 @@
|
||||
<?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');
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user