<?php

declare(strict_types=1);

namespace ImovelZapAi\Publishing\Application\Data;

final readonly class PropertyPublicationBoardData
{
    /**
     * @param  list<PropertyPublicationChannelData>  $channels
     */
    public function __construct(
        public array $channels,
    ) {}

    public function hasPublishedChannels(): bool
    {
        foreach ($this->channels as $channel) {
            if ($channel->canSync) {
                return true;
            }
        }

        return false;
    }

    public function hasPublishableChannels(): bool
    {
        foreach ($this->channels as $channel) {
            if ($channel->canPublish) {
                return true;
            }
        }

        return false;
    }
}
