<?php

namespace App\Notifications;

use App\Models\Complaint;

class ComplaintSubmittedNotification extends HrmsNotification
{
    public function __construct(
        protected Complaint $complaint
    ) {}

    public function notificationCategory(): string
    {
        return 'complaints';
    }

    public function notificationSubject(): string
    {
        return 'New complaint: ' . $this->complaint->subject;
    }

    public function notificationLines(): array
    {
        return [
            'A new complaint has been submitted.',
            'Subject: ' . $this->complaint->subject,
            'From: ' . ($this->complaint->fromUser?->name ?? 'Employee'),
        ];
    }

    public function actionUrl(): ?string
    {
        return route('complaints.index');
    }

    public function actionLabel(): string
    {
        return 'Review complaints';
    }
}
