<?php

namespace App\Modules\HR\Attendance\Notifications;

use App\Modules\HR\Attendance\Models\AttendanceCorrectionRequest;
use App\Support\NotificationCategory;
use Illuminate\Bus\Queueable;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Notifications\Notification;

class AttendanceCorrectionSubmittedNotification extends Notification implements ShouldQueue
{
    use Queueable;

    public function __construct(
        public readonly AttendanceCorrectionRequest $correction,
    ) {}

    /**
     * @return list<string>
     */
    public function via(object $notifiable): array
    {
        return ['database'];
    }

    /**
     * @return array<string, mixed>
     */
    public function toArray(object $notifiable): array
    {
        return [
            'category' => NotificationCategory::APPROVALS,
            'type' => 'attendance_correction_submitted',
            'attendance_correction_request_id' => $this->correction->id,
            'title' => __('attendance_corrections.notifications.submitted_title'),
            'body' => __('attendance_corrections.notifications.submitted_body', ['id' => $this->correction->id]),
        ];
    }
}
