<?php

declare(strict_types=1);

namespace App\Modules\Content\Domain;

class Announcement
{
    public function __construct(
        private readonly string $id,
        private readonly string $tenantId,
        private readonly string $title,
        private readonly string $message,
        private readonly string $visibleUntil,
        private readonly bool $active,
    ) {
    }

    /**
     * @return array<string, mixed>
     */
    public function toArray(): array
    {
        return [
            'id' => $this->id(),
            'tenant_id' => $this->tenantId(),
            'title' => $this->title(),
            'message' => $this->message(),
            'visible_until' => $this->visibleUntil(),
            'active' => $this->active(),
        ];
    }

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

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

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

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

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

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

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