<?php

namespace App\Models;

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

class DentalPerioSite extends Model
{
    protected $table = 'care_dental_perio_sites';

    protected $fillable = [
        'perio_exam_id', 'tooth_code', 'surface',
        'probing_mm', 'bleeding', 'plaque', 'recession_mm',
    ];

    protected function casts(): array
    {
        return [
            'bleeding' => 'boolean',
            'plaque' => 'boolean',
        ];
    }

    public function exam(): BelongsTo
    {
        return $this->belongsTo(DentalPerioExam::class, 'perio_exam_id');
    }
}
