<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;

class MeasurementUnit extends Model
{
    protected $fillable = ['code', 'name', 'is_gst'];

    protected $casts = ['is_gst' => 'boolean'];

    public function displayLabel(): string
    {
        $label = "{$this->name} ({$this->code})";

        return $this->is_gst ? "{$label} - GST" : $label;
    }
}
