<?php

namespace App\Enums;

enum CompanyStatus: string
{
    case Trial     = 'trial';
    case Active    = 'active';
    case Suspended = 'suspended';
    case Cancelled = 'cancelled';

    public function label(): string
    {
        return match ($this) {
            self::Trial     => 'En prueba',
            self::Active    => 'Activa',
            self::Suspended => 'Suspendida',
            self::Cancelled => 'Cancelada',
        };
    }

    public function color(): string
    {
        return match ($this) {
            self::Trial     => 'amber',
            self::Active    => 'emerald',
            self::Suspended => 'rose',
            self::Cancelled => 'gray',
        };
    }

    public function canOperate(): bool
    {
        return in_array($this, [self::Trial, self::Active], true);
    }
}
