<?php

namespace App\Mail;

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

class KYCVerificationMail extends Mailable
{
    use Queueable, SerializesModels;

    public $user;

    /**
     * Create a new message instance.
     */
    public function __construct(User $user)
    {
        $this->user = $user;
    }

    /**
     * Get the message envelope.
     */
    public function envelope(): Envelope
    {
        return new Envelope(
            subject: 'KYC Verification Request',
        );
    }

    /**
     * Get the message content definition.
     */
    public function content(): Content
    {
        $encodedId = base64_encode($this->user->id);

        return new Content(
            view: 'emails.kyc_verification',
            with: [
                'user' => $this->user,
                'approveUrl' => route('admin.users.user_show', ['id' => $encodedId]),
                'rejectUrl' => route('admin.users.user_show', ['id' => $encodedId]),
            ],
        );
    }

    /**
     * Get the attachments for the message.
     *
     * @return array<int, \Illuminate\Mail\Mailables\Attachment>
     */
    public function attachments(): array
    {
        return [];
    }
}
