<?php

namespace App\Modules\HR\Overtime\Notifications;

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

class OvertimeRequestSubmittedNotification extends Notification implements ShouldQueue
{
    use Queueable;

    public function __construct(
        public readonly OvertimeRequest $overtimeRequest,
    ) {}

    /**
     * @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' => 'overtime_submitted',
            'overtime_request_id' => $this->overtimeRequest->id,
            'title' => __('overtime.notifications.submitted_title'),
            'body' => __('overtime.notifications.submitted_body', [
                'id' => $this->overtimeRequest->id,
            ]),
        ];
    }
}
