<?php

namespace App\Models;

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

class Supplier extends Model
{
    use HasFactory;

    protected $fillable = [
        'name',
        'fiscal_code',
        'vat',
        'address',
        'zip_code',
        'nation_id',
        'province_id',
        'city_id',
        'referent',
        'website',
        'phone',
        'email',
        'referent_first_name',
        'referent_last_name',
        'referent_email',
        'referent_phone',
        'referent_mobile',
        'enabled'
    ];

    public function nation()
    {
        return $this->belongsTo(\App\Models\Nation::class);
    }

    public function province()
    {
        return $this->belongsTo(\App\Models\Province::class);
    }

    public function city()
    {
        return $this->belongsTo(\App\Models\City::class);
    }

}
