<?php

namespace App\Enums;

enum RegistrationStatus: string
{
    case Pending = 'pending';
    case PendingPayment = 'pending_payment';
    case PaymentReview = 'payment_review';
    case Confirmed = 'confirmed';
    case Waitlisted = 'waitlisted';
    case Rejected = 'rejected';
    case Cancelled = 'cancelled';
    case CheckedIn = 'checked_in';
    case Attended = 'attended';
    case Disqualified = 'disqualified';

    public function label(): string
    {
        return match ($this) {
            self::Pending => __('enums.registration_status.pending'),
            self::PendingPayment => __('enums.registration_status.pending_payment'),
            self::PaymentReview => __('enums.registration_status.payment_review'),
            self::Confirmed => __('enums.registration_status.confirmed'),
            self::Waitlisted => __('enums.registration_status.waitlisted'),
            self::Rejected => __('enums.registration_status.rejected'),
            self::Cancelled => __('enums.registration_status.cancelled'),
            self::CheckedIn => __('enums.registration_status.checked_in'),
            self::Attended => __('enums.registration_status.attended'),
            self::Disqualified => __('enums.registration_status.disqualified'),
        };
    }

    public function isActive(): bool
    {
        return ! in_array($this, [self::Rejected, self::Cancelled, self::Disqualified], true);
    }
}
