<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;

class OrderRole extends Model
{
    use HasFactory;

    protected $fillable = ['entity_hash_id', 'entity_signature'];

    /**
     * @return BelongsTo
     */
    public function Order(): BelongsTo
    {
        return $this->BelongsTo( Order::class, 'order_id', 'id');
    }

    /**
     * @return BelongsTo
     */
    public function Appointee(): BelongsTo
    {
        return $this->BelongsTo( CompanyModule::class, 'company_module_id', 'id');
    }
}
