<?php

namespace App\Models;

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

class LogPerawatan extends Model
{
    use HasFactory;

    protected $table = 'log_perawatan';
    
    protected $fillable = [
        'jenis_perawatan_id',
        'jadwal_perawatan_id',
        'tanggal_pengerjaan',
        'dikerjakan_oleh',
        'keterangan',
        'perlu_tindak_lanjut'
    ];

    public function jenisPerawatan()
    {
        return $this->belongsTo(JenisPerawatan::class, 'jenis_perawatan_id');
    }

    public function jadwalPerawatan()
    {
        return $this->belongsTo(JadwalPerawatan::class, 'jadwal_perawatan_id');
    }
}