<?php

namespace App\Models;

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

class KnowledgePoint extends Model
{
    use HasFactory;

    protected $table = 'knowledge_points';

    protected $fillable = [
        'kp_code',
        'name',
        'subject',
        'grade',
        'parent_kp_code',
        'prerequisite_kp_codes',
        'dependent_kp_codes',
        'related_kp_codes',
        'stats',
    ];

    protected $casts = [
        'prerequisite_kp_codes' => 'array',
        'dependent_kp_codes' => 'array',
        'related_kp_codes' => 'array',
        'stats' => 'array',
        'created_at' => 'datetime',
        'updated_at' => 'datetime',
    ];
}
