<?php

declare(strict_types=1);

namespace App\Modules\Content\Domain;

class FaqItem
{
    public function __construct(
        private readonly string $id,
        private readonly string $tenantId,
        private readonly string $question,
        private readonly string $answer,
        private readonly int $sortOrder,
        private readonly bool $active,
    ) {
    }

    /**
     * @return array<string, mixed>
     */
    public function toArray(): array
    {
        return [
            'id' => $this->id(),
            'tenant_id' => $this->tenantId(),
            'question' => $this->question(),
            'answer' => $this->answer(),
            'sort_order' => $this->sortOrder(),
            'active' => $this->active(),
        ];
    }

    public function id(): string
    {
        return $this->id;
    }

    public function tenantId(): string
    {
        return $this->tenantId;
    }

    public function question(): string
    {
        return $this->question;
    }

    public function answer(): string
    {
        return $this->answer;
    }

    public function sortOrder(): int
    {
        return $this->sortOrder;
    }

    public function active(): bool
    {
        return $this->active;
    }

    public function isEditableByTenantAdmin(): bool
    {
        return true;
    }
}
