<?php

namespace App\Enums;

enum WalletType: string
{
    case DEMO = 'demo';
    case BONUS = 'bonus';
    case REAL = 'real';

    /**
     * Get human-readable label
     */
    public function label(): string
    {
        return match($this) {
            self::DEMO => 'Demo Account',
            self::BONUS => 'Bonus Account',
            self::REAL => 'Real Account',
        };
    }

    /**
     * Check if wallet can trade crypto markets
     */
    public function canTradeCrypto(): bool
    {
        return match($this) {
            self::DEMO => true,
            self::BONUS => false,
            self::REAL => true,
        };
    }

    /**
     * Check if wallet can trade OTC markets
     */
    public function canTradeOTC(): bool
    {
        return match($this) {
            self::DEMO => true,
            self::BONUS => true,
            self::REAL => true,
        };
    }

    /**
     * Check if wallet can withdraw
     */
    public function canWithdraw(): bool
    {
        return match($this) {
            self::DEMO => false,
            self::BONUS => false,
            self::REAL => true,
        };
    }

    /**
     * Check if wallet uses fair trading
     */
    public function usesFairTrading(): bool
    {
        return match($this) {
            self::DEMO => true,
            self::BONUS => false,
            self::REAL => false,
        };
    }

    /**
     * Check if wallet is beginner friendly
     */
    public function isBeginnerFriendly(): bool
    {
        return match($this) {
            self::DEMO => false,
            self::BONUS => true,
            self::REAL => false,
        };
    }

    /**
     * Get all wallet types
     */
    public static function all(): array
    {
        return [
            self::DEMO,
            self::BONUS,
            self::REAL,
        ];
    }

    /**
     * Get wallet types as array of values
     */
    public static function values(): array
    {
        return array_map(fn($case) => $case->value, self::cases());
    }
}

// Made with Bob