<?php

namespace App\Mail;

use App\Models\TravelRequest;
use App\Models\User;
use Illuminate\Bus\Queueable;
use Illuminate\Mail\Mailable;
use Illuminate\Mail\Mailables\Content;
use Illuminate\Mail\Mailables\Envelope;
use Illuminate\Queue\SerializesModels;

class ApprovalRequestMail extends Mailable
{
    use Queueable, SerializesModels;

    public function __construct(
        public readonly TravelRequest $travelRequest,
        public readonly User $approver,
        public readonly string $signedUrl,
    ) {}

    public function envelope(): Envelope
    {
        return new Envelope(
            subject: 'Action Required: Travel Request #' . $this->travelRequest->id . ' Awaiting Your Approval',
        );
    }

    public function content(): Content
    {
        return new Content(
            view: 'mail.approval-request',
        );
    }
}
