<?php

namespace Modules\ClinicCore\Entities;

use Illuminate\Database\Eloquent\Model;

/**
 * Item 1.4 - per-business knobs for the structured exam UX.
 */
class ClcExamSetting extends Model
{
    protected $table = 'clc_exam_settings';
    protected $guarded = ['id'];

    protected $casts = [
        'visible_specialist_template_ids' => 'array',
        'enable_ai_suggest'               => 'boolean',
        'enable_comparison_with_previous' => 'boolean',
        'enable_voice_fill'               => 'boolean',
    ];

    /** Lazily create the settings row on first read. */
    public static function forBusiness($businessId): self
    {
        return static::firstOrCreate(['business_id' => $businessId]);
    }
}
