<?php

namespace App\Models;

use App\Traits\Auditable;

use Illuminate\Database\Eloquent\Model;

/**
 * @property string $id
 * @property string $especiality_id
 * @property json $section_types
 * @property json $medical_exams
 * @property string $created_at
 * @property string $updated_at
 * @property Especiality $especiality
 */
class HistoryConfiguration extends Model
{
    use Auditable;
    /**
     * The table associated with the model.
     * 
     * @var string
     */
    protected $table = 'history_configuration';

    /**
     * The "type" of the auto-incrementing ID.
     * 
     * @var string
     */
    protected $keyType = 'string';

    /**
     * Indicates if the IDs are auto-incrementing.
     * 
     * @var bool
     */
    public $incrementing = false;

    /**
     * The attributes that are mass assignable.
     *
     * @var array
     */
    protected $fillable = [
        'id',
        'especiality_id',
        'section_types',
        'medical_exams',
        'created_at',
        'updated_at'
    ];

    /**
     * The attributes that should be cast.
     *
     * @var array
     */
    protected $casts = [
        'section_types' => 'array',
        'medical_exams' => 'array'
    ];

    /**
     * Get the especiality that owns the configuration.
     */
    public function especiality()
    {
        return $this->belongsTo(Especiality::class);
    }
} 