<?php

namespace App\Models;

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

class UserProfile extends Model
{
    use HasFactory;

    protected $fillable = [
        'user_id',
        'bio',
        'address',
        'city',
        'state_province',
        'postal_code',
        'country',
        'date_of_birth',
        'gender',
        'profile_completed',
        'preferences',
    ];

    protected $casts = [
        'date_of_birth' => 'date',
        'profile_completed' => 'boolean',
        'preferences' => 'json',
    ];

    public function user(): BelongsTo
    {
        return $this->belongsTo(User::class);
    }
}
