<?php

namespace Modules\Vrc\Entities;

use Illuminate\Database\Eloquent\Model;

class VrcStorageBin extends Model
{
    protected $table = 'vrc_storage_bins';

    protected $fillable = [
        'business_id', 'location_id', 'code', 'zone', 'rack', 'shelf', 'description', 'is_active',
    ];

    protected $casts = [
        'is_active' => 'boolean',
    ];

    public function label(): string
    {
        return trim(collect([$this->zone, $this->rack, $this->shelf])->filter()->implode(' / ')) ?: $this->code;
    }
}
