<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;

class LifestyleRecord extends Model
{
    protected $fillable = [
        'assessment_id',
        'occupation',
        'job_type',
        'avg_sleep_hours',
        'stress_level',
        'smokes',
        'drinks_alcohol',
        'can_eat_regularly',
        'can_eat_healthy',
        'additional_notes',
    ];

    protected function casts(): array
    {
        return [
            'smokes' => 'boolean',
            'drinks_alcohol' => 'boolean',
            'can_eat_regularly' => 'boolean',
            'can_eat_healthy' => 'boolean',
        ];
    }

    public function assessment()
    {
        return $this->belongsTo(AthleteAssessment::class, 'assessment_id');
    }
}
