<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;

use App\Models\DidikPokok;
use App\Models\Kelas;
use App\Models\MataPelajaran;

class PenilaianIntrakulikuler extends Model
{
    protected $table = 'penilaian_intrakulikuler';

    protected $fillable = [
        'kelas_id',
        'peserta_didik_id',
        'mata_pelajaran_id',
        'nilai1', 'nilai2', 'nilai3', 'nilai4', 'nilai5', 'nilai6',
        'n_sumatif', 'n_akhir_semester', 'nilai_akhir',
        'deskripsi',
    ];

    /**
     * Peserta didik relation
     */
    public function peserta_didik(): BelongsTo
    {
        return $this->belongsTo(DidikPokok::class, 'peserta_didik_id');
    }

    /**
     * Kelas relation
     */
    public function kelas(): BelongsTo
    {
        return $this->belongsTo(Kelas::class, 'kelas_id');
    }

    /**
     * Mata pelajaran relation
     */
    public function mata_pelajaran(): BelongsTo
    {
        return $this->belongsTo(MataPelajaran::class, 'mata_pelajaran_id');
    }

}
