<?php

declare(strict_types=1);

/*
 * This file is part of the Ferienpass package.
 *
 * (c) Richard Henkenjohann <richard@ferienpass.online>
 *
 * For more information visit the project website <https://ferienpass.online>
 * or the documentation under <https://docs.ferienpass.online>.
 */

namespace Ferienpass\AdminBundle\Components;

/**
 * A recipient of a Rundmail as the collapsed outbox list needs them: a name, an
 * address and a delivery dot.
 *
 * The list shows two avatars and a count per campaign, so hydrating every
 * recipient as a {@see \Ferienpass\CoreBundle\Entity\SentEmail} means dragging
 * each one's full HTML body out of the emailData blob — thousands of them, on
 * every keystroke — to render two initials. This carries just the columns the
 * row reads, filled straight from a scalar query.
 *
 * Expanding a campaign, or opening one in the detail pane, still loads the real
 * entities: those views need the body, the engagements and the conversation.
 */
final class OutboxRecipient
{
    public function __construct(
        private readonly int $id,
        private readonly ?string $to,
        private readonly ?string $name,
        private readonly ?string $subject,
        private readonly string $deliveryStatus,
    ) {
    }

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

    public function getTo(): ?string
    {
        return $this->to;
    }

    public function getName(): ?string
    {
        return $this->name;
    }

    public function getSubject(): ?string
    {
        return $this->subject;
    }

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