<?php

namespace App\Monitor;

enum MonitorEvents
{
    case MONITOR_ADDED;
    case MONITOR_STARTED;
    case MONITOR_FINISHED;
    case MONITOR_DELETED;
    case MONITOR_ERROR;

    public function type(): string
    {
        return match ($this) {
            self::MONITOR_ADDED => 'monitor_added',
            self::MONITOR_STARTED => 'monitor_started',
            self::MONITOR_FINISHED => 'monitor_finished',
            self::MONITOR_DELETED => 'monitor_deleted',
            self::MONITOR_ERROR => 'monitor_error',
        };
    }

    public function message(): string
    {
        return match ($this) {
            self::MONITOR_ADDED => 'A new monitor has been added.',
            self::MONITOR_STARTED => 'A monitor has started.',
            self::MONITOR_FINISHED => 'A monitor has finished.',
            self::MONITOR_DELETED => 'A monitor has been deleted',
            self::MONITOR_ERROR => 'A monitor has encountered an error.',
        };
    }
}
