<?php

namespace App\Models;

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

class UserPreference extends Model
{
    use HasFactory;

    protected $fillable = [
        'sect_id',
        'education_id',
        'profession_id',
        'from_height_cm',
        'to_height_cm',
        'from_height_ft',
        'to_height_ft',
        'from_weight_kg',
        'to_weight_kg',
        'from_weight_lbs',
        'to_weight_lbs',
        'marital_status',
        'religion_practice',
        'dress_code_id',
        'weight_all',
        'height_all',
        'smoking',
        'user_id',
        'prefrance_setup_completed',
        'city_emirate_id',
    ];

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

    public function sect()
    {
        return $this->belongsTo(Sect::class);
    }

    public function education()
    {
        return $this->belongsTo(Education::class);
    }

    public function profession()
    {
        return $this->belongsTo(Profession::class);
    }

    public function maritalStatus()
    {
        return $this->belongsTo(MaritalStatus::class, 'marital_status');
    }

    public function dressCode()
    {
        return $this->belongsTo(DressCode::class);
    }

    public function city_emirate()
    {
        return $this->hasOne(Emirate::class, 'id', 'city_emirate_id')->withDefault(['id' => '', 'name' => '', 'name_ar' => '', 'country_id' => '', 'status' => '']);
    }

}