<?php

namespace Kylin\Licensing\Enums;

/**
 * 许可证类型
 */
enum LicenseType: string
{
    case Trial = 'trial';
    case Standard = 'standard';
    case Professional = 'professional';
    case Enterprise = 'enterprise';

    public function label(): string
    {
        return match ($this) {
            self::Trial => '试用版',
            self::Standard => '标准版',
            self::Professional => '专业版',
            self::Enterprise => '企业版',
        };
    }

    public function maxDevices(): int
    {
        return match ($this) {
            self::Trial => 1,
            self::Standard => 3,
            self::Professional => 10,
            self::Enterprise => PHP_INT_MAX,
        };
    }
}
