<?php

namespace App\Enums;

enum ActivityTypeEnum: string
{
    case FETCH = 'fetch';
    case VALIDATE = 'validate';
    case APPROVE = 'approve';
    case REJECT = 'reject';
    case PUBLISH = 'publish';
    case ERROR = 'error';

    public function label(): string
    {
        return match ($this) {
            self::FETCH => 'Fetched',
            self::VALIDATE => 'Validated',
            self::APPROVE => 'Approved',
            self::REJECT => 'Rejected',
            self::PUBLISH => 'Published',
            self::ERROR => 'Error',
        };
    }

    /**
     * @return array<string, string>
     */
    public static function options(): array
    {
        $options = [];

        foreach (self::cases() as $case) {
            $options[$case->value] = $case->label();
        }

        return $options;
    }
}
