<?php

namespace App\Enums;

enum MarketType: string
{
    case CRYPTO = 'crypto';
    case OTC = 'otc';

    /**
     * Get human-readable label
     */
    public function label(): string
    {
        return match($this) {
            self::CRYPTO => 'Crypto Market',
            self::OTC => 'OTC Market',
        };
    }

    /**
     * Check if market uses real data
     */
    public function usesRealData(): bool
    {
        return match($this) {
            self::CRYPTO => true,
            self::OTC => false,
        };
    }

    /**
     * Get all market types
     */
    public static function all(): array
    {
        return [
            self::CRYPTO,
            self::OTC,
        ];
    }

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

// Made with Bob