<?php

namespace App\Mail;

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

class TransferRequestUpdated extends Mailable
{
    use Queueable, SerializesModels;

    public function __construct(
        public TransferRequest $transfer,
        public string $decision,
    ) {}

    public function envelope(): Envelope
    {
        $status = ucfirst($this->decision);
        return new Envelope(
            subject: "Transfer Request {$status} - " . config('app.name'),
        );
    }

    public function content(): Content
    {
        return new Content(
            view: 'emails.transfer-updated',
        );
    }
}
