<?php

namespace Modules\Approval\Traits;

use Illuminate\Database\Eloquent\Relations\MorphOne;
use Modules\Approval\Models\ApprovalRequest;

trait Approvable
{
    public function approvalRequest(): MorphOne
    {
        /** @var \Illuminate\Database\Eloquent\Model $this */
        
        return $this->morphOne(ApprovalRequest::class, 'approvable');
    }

    abstract public static function approvalWorkflowCode(): string;

    abstract public function approvalHandler(): string;
}
