<?php

declare(strict_types=1);

namespace App\Support\Governance;

final class GovernanceSubjectType
{
    public function __construct(
        public readonly GovernanceDomainKey $domainKey,
        public readonly GovernanceSubjectClass $subjectClass,
        public readonly string $subjectTypeKey,
        public readonly string $label,
        public readonly ?string $description,
        public readonly bool $captureSupported,
        public readonly bool $compareSupported,
        public readonly bool $inventorySupported,
        public readonly bool $active,
        public readonly ?string $supportMode = null,
        public readonly ?string $legacyBucket = null,
    ) {}

    /**
     * @return array<string, bool|null|string>
     */
    public function toArray(): array
    {
        return [
            'domain_key' => $this->domainKey->value,
            'subject_class' => $this->subjectClass->value,
            'subject_type_key' => $this->subjectTypeKey,
            'label' => $this->label,
            'description' => $this->description,
            'capture_supported' => $this->captureSupported,
            'compare_supported' => $this->compareSupported,
            'inventory_supported' => $this->inventorySupported,
            'active' => $this->active,
            'support_mode' => $this->supportMode,
            'legacy_bucket' => $this->legacyBucket,
        ];
    }
}