<?php

namespace App\Models;

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

class Hukum extends Model
{
    use HasFactory;

    protected $table = 'Hukum';
    protected $primaryKey = 'HukumId';

    protected $fillable = [
        'PerusahaanId',
        'JenisSanksiId',
        'SanksiNumber',
        'SanksiDate',
        'SanksiFile',
        'PenaatanId',
        'PenaatanNumber',
        'PenaatanDate',
        'PenaatanFile',
    ];

    public $timestamps = true;

    public function perusahaan()
    {
        return $this->belongsTo(Perusahaan::class, 'PerusahaanId');
    }

    public function jenisSanksi()
    {
        return $this->belongsTo(JenisSanksi::class, 'JenisSanksiId');
    }

    public function penaatan()
    {
        return $this->belongsTo(Penaatan::class, 'PenaatanId');
    }
}
