<?php

declare(strict_types=1);

namespace App\Application\LiveComponents\ValueObjects;

/**
 * MetricId - Unique identifier for a metric
 */
final readonly class MetricId
{
    public function __construct(
        public string $value
    ) {
        if (empty($value)) {
            throw new \InvalidArgumentException('Metric ID cannot be empty');
        }
    }

    public static function revenue(): self
    {
        return new self('revenue');
    }

    public static function users(): self
    {
        return new self('users');
    }

    public static function conversions(): self
    {
        return new self('conversions');
    }

    public static function orders(): self
    {
        return new self('orders');
    }

    public static function averageOrderValue(): self
    {
        return new self('avg_order_value');
    }

    public static function bounceRate(): self
    {
        return new self('bounce_rate');
    }

    public function equals(self $other): bool
    {
        return $this->value === $other->value;
    }
}
