<?php

namespace Modules\Accounts\Models\Traits;

use Illuminate\Database\Eloquent\Relations\BelongsTo;
use Illuminate\Database\Eloquent\Relations\MorphTo;
use Modules\Accounts\Models\VatSettlement;

/**
 * @mixin \Illuminate\Database\Eloquent\Model
 * @method MorphTo morphTo(string|null $name = null, string|null $type = null, string|null $id = null, string|null $ownerKey = null)
 * @method BelongsTo belongsTo($related, string|null $foreignKey = null, string|null $ownerKey = null, string|null $relation = null)
 */

trait VatTransactionRelationshipTrait
{
    public function source(): MorphTo
    {
        return $this->morphTo();
    }

    public function itemable(): MorphTo
    {
        return $this->morphTo();
    }

    public function vatSettlement(): BelongsTo
    {
        return $this->belongsTo(VatSettlement::class, 'vat_settlement_id');
    }
}
