<?php

namespace App\Models;

use App\Models\MasterUnit;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;

class MaintenanceUnit extends Model
{
    use HasFactory;

    protected $table    = 'tbl_maintenance_units';
    protected $fillable = [
        'project_id',
        'project_code',
        'mnt_num',
        'mnt_code',
        'mnt_date',
        'step',
        'unit_id',
        'unit_code',
        'description'
    ];

    public function unit(): BelongsTo
    {
        return $this->belongsTo(MasterUnit::class);
    }
}
