<?php
declare(strict_types=1);

namespace App\Core\Contracts;

interface WorkflowEngineInterface
{
    public function createInstance(string $workflowCode, string $entityType, int $entityId, ?array $stateData = null): object;

    public function transition(int $instanceId, string $transitionName, ?string $notes = null, string $triggerType = 'manual'): bool;

    public function getAvailableTransitions(int $instanceId): array;

    public function transitionByEntity(string $entityType, int $entityId, string $transitionName, ?string $notes = null): bool;

    public function getCurrentState(string $entityType, int $entityId, ?string $workflowCode = null): ?string;

    public function getHistory(int $instanceId): array;
}
