<?php

declare(strict_types=1);

namespace App\Models\Concerns;

use App\Models\DberpUnit;
use Illuminate\Database\Eloquent\Relations\BelongsTo;

trait HasDberpDocumentLineUnitRelations
{
    public function unit(): BelongsTo
    {
        return $this->belongsTo(DberpUnit::class, 'unit_id');
    }

    public function baseUnit(): BelongsTo
    {
        return $this->belongsTo(DberpUnit::class, 'base_unit_id');
    }

    public function auxiliaryUnit(): BelongsTo
    {
        return $this->belongsTo(DberpUnit::class, 'auxiliary_unit_id');
    }
}
