<?php

namespace App\Models;

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

class LoadType extends Model
{
    use HasFactory;

    protected $table = 'load_types';

    protected $fillable = [
        'code',
        'name',
        'sort_order',
    ];

    protected $casts = [
        'sort_order' => 'integer',
    ];

    public const CODE_HEAVY = 'heavy';
    public const CODE_LIGHT = 'light';

    public function orderAreaPresences(): HasMany
    {
        return $this->hasMany(OrderAreaPresence::class, 'load_type_id');
    }

    public function ordenLavanderiaDetalles(): HasMany
    {
        return $this->hasMany(OrdenLavanderiaDetalle::class, 'load_type_id');
    }
}
