<?php

namespace MintyPHP\Domain\Taxonomy;

enum SchedulerRuntimeResult: string
{
    use SupportsStringTaxonomy;

    case Ok = 'ok';
    case LockNotAcquired = 'lock_not_acquired';
    case UnexpectedError = 'unexpected_error';

    public function labelToken(): string
    {
        return match ($this) {
            self::Ok => 'OK',
            self::LockNotAcquired => 'Lock not acquired',
            self::UnexpectedError => 'Unexpected error',
        };
    }

    public function badgeVariant(): string
    {
        return match ($this) {
            self::Ok => 'success',
            self::LockNotAcquired => 'warning',
            self::UnexpectedError => 'danger',
        };
    }
}
