<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;

class Deployment extends Model
{
    use HasFactory, SoftDeletes;

    protected $fillable = [
        'ndrt_officer_id',
        'start_date',
        'end_date',
        'has_mentor',
        'mentor_name',
        'is_extended',
        'extension_reason',
        'new_completion_date',
        'mission_location',
        'mission_description',
        'reporting_to',
        'equipment_log',
        'status',
        'mission_end_date',
        'branch_debrief_remarks',
        'hq_debrief_remarks',
        'report_path',
    ];

    protected $casts = [
        'start_date' => 'date',
        'end_date' => 'date',
        'new_completion_date' => 'date',
        'mission_end_date' => 'date',
        'has_mentor' => 'boolean',
        'is_extended' => 'boolean',
        'equipment_log' => 'array',
    ];

    public function ndrtOfficer()
    {
        return $this->belongsTo(NdrtOfficer::class);
    }
}