<?php

namespace App\Mail;

use App\Models\Central\Company;
use App\Models\Tenant\ShopCustomer;
use Illuminate\Bus\Queueable;
use Illuminate\Mail\Mailable;
use Illuminate\Mail\Mailables\Content;
use Illuminate\Mail\Mailables\Envelope;
use Illuminate\Queue\SerializesModels;

class ShopPasswordResetMail extends Mailable
{
    use Queueable, SerializesModels;

    public function __construct(
        public ShopCustomer $customer,
        public Company $company,
        public string $resetUrl,
    ) {}

    public function envelope(): Envelope
    {
        $brand = $this->company->display_name ?? $this->company->name;
        return new Envelope(
            subject: "Resetare parolă — {$brand}",
        );
    }

    public function content(): Content
    {
        return new Content(
            view: 'emails.shop.password-reset',
            with: [
                'customer' => $this->customer,
                'company' => $this->company,
                'resetUrl' => $this->resetUrl,
            ],
        );
    }
}
