<?php

declare(strict_types=1);

namespace App\Mail;

use App\Models\Tenant;
use App\Services\Billing\PreflightResult;
use Illuminate\Bus\Queueable;
use Illuminate\Mail\Mailable;
use Illuminate\Mail\Mailables\Content;
use Illuminate\Mail\Mailables\Envelope;
use Illuminate\Queue\SerializesModels;

/**
 * Письмо-напоминание: приём лидов всё ещё приостановлен (Billing v2 Spec C §3.7, T+24h).
 */
final class BalanceFrozenReminderMail extends Mailable
{
    use Queueable;
    use SerializesModels;

    public function __construct(
        public readonly Tenant $tenant,
        public readonly PreflightResult $result,
    ) {}

    public function envelope(): Envelope
    {
        return new Envelope(
            subject: 'Приём лидов всё ещё приостановлен',
            to: [$this->tenant->contact_email],
        );
    }

    public function content(): Content
    {
        return new Content(view: 'emails.balance_frozen_reminder');
    }
}
