<?php

declare(strict_types=1);

namespace ImovelZapAi\Documents\Domain\Enums;

enum DocumentStatus: string
{
    case Draft = 'draft';
    case Shared = 'shared';
    case Accepted = 'accepted';
    case Rejected = 'rejected';
    case ChangesRequested = 'changes_requested';
    case Expired = 'expired';

    public function label(): string
    {
        return match ($this) {
            self::Draft => 'Rascunho',
            self::Shared => 'Compartilhado',
            self::Accepted => 'Aceito',
            self::Rejected => 'Recusado',
            self::ChangesRequested => 'Alteração solicitada',
            self::Expired => 'Expirado',
        };
    }

    public function isOpen(): bool
    {
        return in_array($this, [self::Draft, self::Shared, self::ChangesRequested], true);
    }
}
