<?php

namespace App\Models\Tenant;

use App\Models\Concerns\BelongsToTenant;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;

class LaborPart extends Model
{
    use BelongsToTenant;

    protected $fillable = ['company_id', 'labor_id', 'part_id', 'qty', 'unit'];

    protected $casts = ['qty' => 'decimal:2'];

    public function labor(): BelongsTo
    {
        return $this->belongsTo(Labor::class);
    }

    public function part(): BelongsTo
    {
        return $this->belongsTo(Part::class);
    }
}
