<?php

namespace App\Enums;

/**
 * Status akun pengguna.
 */
enum UserStatus: string
{
    case Active = 'active';
    case Suspended = 'suspended';
    case Deactivated = 'deactivated';

    public function label(): string
    {
        return match ($this) {
            self::Active => 'Aktif',
            self::Suspended => 'Diskors',
            self::Deactivated => 'Dinonaktifkan',
        };
    }

    /**
     * Apakah user boleh login & menggunakan sistem?
     */
    public function canLogin(): bool
    {
        return $this === self::Active;
    }
}
