<?php

declare(strict_types=1);

namespace App\Framework\UserAgent\ValueObjects;

/**
 * Value Object representing device category
 */
enum DeviceCategory: string
{
    case BOT = 'bot';
    case MOBILE = 'mobile';
    case DESKTOP = 'desktop';
    case TABLET = 'tablet';
    case UNKNOWN = 'unknown';

    /**
     * Get human-readable display name
     */
    public function getDisplayName(): string
    {
        return match ($this) {
            self::BOT => 'Bot',
            self::MOBILE => 'Mobile Device',
            self::DESKTOP => 'Desktop Computer',
            self::TABLET => 'Tablet',
            self::UNKNOWN => 'Unknown Device',
        };
    }

    /**
     * Check if device is mobile (includes tablets)
     */
    public function isMobile(): bool
    {
        return match ($this) {
            self::MOBILE, self::TABLET => true,
            default => false,
        };
    }

    /**
     * Check if device is desktop
     */
    public function isDesktop(): bool
    {
        return $this === self::DESKTOP;
    }

    /**
     * Check if device is a bot
     */
    public function isBot(): bool
    {
        return $this === self::BOT;
    }
}
