<?php

namespace App\Actions\Communications;

use App\Enum\Contact\MessageChannel;
use App\ValueObjects\Communications\RecipientSnapshot;
use Illuminate\Database\Eloquent\Model;

/**
 * Thin façade over ValidateRecipientAction used by UI components to decide
 * whether a quick-send button should be disabled and which tooltip to show.
 * Server-side checks remain authoritative in DispatchContactMessageAction.
 */
class AssertCanContactAction
{
    public function __construct(
        protected ValidateRecipientAction $validate,
    ) {}

    public function __invoke(MessageChannel $channel, Model $recipient): RecipientSnapshot
    {
        return ($this->validate)($channel, $recipient);
    }
}
