<?php

namespace App\Models\User;

use App\Traits\UuidTrait;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use App\Models\Admin\MsUnitKerja;
use App\Models\Admin\MsTingkatPendidikan;
use App\Models\Admin\MsJabatan;

class StafPendukung extends Model
{
    use HasFactory;
    use UuidTrait;

    public $incrementing = false;
    protected $table = 'stafpendukung';
    protected $keyType = 'string';

    protected $fillable = [
        'id', 'nip', 'nama', 'sex', 'jabatan', 'unit_kerja', 'tingkat_pendidikan', 'userid_created', 'userid_updated', 'created_at', 'updated_at',
    ];

    public function rUnitkerja()
    {
        return $this->belongsTo(MsUnitKerja::class, 'unit_kerja', 'kode');
    }

    public function rTingkatpendidikan()
    {
        return $this->belongsTo(MsTingkatPendidikan::class, 'tingkat_pendidikan', 'kode');
    }

    public function rJabatan()
    {
        return $this->belongsTo(MsJabatan::class, 'jabatan', 'kode');
    }
}
