<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
use Illuminate\Database\Eloquent\Relations\HasMany;

class IndikatorKompetensi extends Model
{
    use HasFactory;

    protected $table = 'indikator_kompetensi';

    protected $fillable = [
        'kompetensi_id',
        'jenjang_jabatan_id',
        'kode_indikator',
        'pertanyaan',
    ];

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

    public function jenjangJabatan(): BelongsTo
    {
        return $this->belongsTo(JenjangJabatan::class, 'jenjang_jabatan_id');
    }

    public function assessments(): HasMany
    {
        return $this->hasMany(AssessmentKompetensi::class);
    }
}
