<?php

declare(strict_types=1);

namespace App\Framework\Queue\ValueObjects;

/**
 * Enum representing different execution modes for job chains
 */
enum ChainExecutionMode: string
{
    case SEQUENTIAL = 'sequential';
    case PARALLEL = 'parallel';
    case CONDITIONAL = 'conditional';

    public function getDescription(): string
    {
        return match ($this) {
            self::SEQUENTIAL => 'Jobs execute one after another in order',
            self::PARALLEL => 'All jobs execute simultaneously',
            self::CONDITIONAL => 'Job execution depends on conditions and dependencies'
        };
    }

    public function allowsParallelExecution(): bool
    {
        return $this === self::PARALLEL;
    }

    public function requiresStrictOrder(): bool
    {
        return $this === self::SEQUENTIAL;
    }

    public function supportsConditionalLogic(): bool
    {
        return $this === self::CONDITIONAL;
    }
}
