<?php

namespace App\Mail;

use App\Models\Empleado;
use App\Models\Periodo;
use Carbon\Carbon;
use Illuminate\Bus\Queueable;
use Illuminate\Mail\Mailable;
use Illuminate\Mail\Mailables\Content;
use Illuminate\Mail\Mailables\Envelope;
use Illuminate\Queue\SerializesModels;

class RecordatorioEmpleadoMail extends Mailable
{
    use Queueable, SerializesModels;

    public function __construct(
        public Empleado $empleado,
        public Periodo  $periodo,
        public Carbon   $fecha,
    ) {}

    public function envelope(): Envelope
    {
        return new Envelope(
            subject: 'Recordatorio: Diligencie su hoja de tiempo hoy — ' . $this->fecha->isoFormat('dddd D [de] MMMM'),
        );
    }

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