<?php

namespace App\Enums;

enum QueueStatus: string
{
    case CHECKED_IN = 'checked_in';
    case WAITING = 'waiting';
    case WITH_DOCTOR = 'with_doctor';
    case COMPLETED = 'completed';
    case NO_SHOW = 'no_show';
    case CANCELLED = 'cancelled';

    public function allowedNext(): array
    {
        return match ($this) {
            self::CHECKED_IN => [self::WAITING, self::NO_SHOW, self::CANCELLED],
            self::WAITING => [self::WITH_DOCTOR, self::NO_SHOW, self::CANCELLED],
            self::WITH_DOCTOR => [self::COMPLETED, self::WAITING, self::NO_SHOW],
            self::COMPLETED, self::NO_SHOW, self::CANCELLED => [],
        };
    }
}
