<?php

namespace App\Models;

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

class LocalIndustriel extends Model
{
    use HasFactory;

    public $fillable = [
        'standing',
        'zone_economique',
        'surface_utile',
        'surface_totale',
        'surface_divisible',
        'surface_minimum',
        'categorie',
    ];

    protected $table = 'local_industriels';

    public function bien(){
        return $this->hasOne(Bien::class);
    }

    public function categorie() {
        switch($this->categorie) {
            case 52:
                return 'local industriel / d\'activités';
                break;
            case 53:
                return 'Entrepôt';
                break;
        }
    }

    public function zone_economique() {
        switch($this->zone_economique) {
            case 110:
                return 'industrielle';
                break;
            case 111:
                return 'rurale';
                break;            
            case 112:
                return 'urbaine';
                break;
        }
    }

    public function standing() {
        switch($this->standing) {
            case 1:
                return 'nomal';
                break;
            case 2:
                return 'bon';
                break;
            case 3:
                return 'grand standing';
                break;
            case 400:
                return 'luxe';
                break;
        }
    }
}
