<?php

namespace App\Models;

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

class RiwayatRekomendasi extends Model
{
    use HasFactory;

    protected $table = 'riwayat_rekomendasis';

    protected $fillable = [
        'user_id',

        'agama',
        'pkn',
        'bahasa_indonesia',
        'bahasa_inggris',
        'matematika',
        'fisika',
        'kimia',
        'biologi',
        'sejarah',
        'geografi',
        'ekonomi_mapel',
        'sosiologi',
        'seni_budaya',
        'pjok',
        'informatika',

        'riasec_r',
        'riasec_i',
        'riasec_a',
        'riasec_s',
        'riasec_e',
        'riasec_c',

        'gaji_ortu',
        'hasil_rekomendasi_jurusan',
        'akurasi_prediksi',
        'detail_probabilitas',
    ];

    protected $casts = [
        'agama' => 'float',
        'pkn' => 'float',
        'bahasa_indonesia' => 'float',
        'bahasa_inggris' => 'float',
        'matematika' => 'float',
        'fisika' => 'float',
        'kimia' => 'float',
        'biologi' => 'float',
        'sejarah' => 'float',
        'geografi' => 'float',
        'ekonomi_mapel' => 'float',
        'sosiologi' => 'float',
        'seni_budaya' => 'float',
        'pjok' => 'float',
        'informatika' => 'float',

        'riasec_r' => 'float',
        'riasec_i' => 'float',
        'riasec_a' => 'float',
        'riasec_s' => 'float',
        'riasec_e' => 'float',
        'riasec_c' => 'float',

        'gaji_ortu' => 'float',
        'akurasi_prediksi' => 'float',
        'detail_probabilitas' => 'array',
    ];

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