<?php

namespace App\Notifications;

use App\Models\Complaint;

class ComplaintStatusChangedNotification extends HrmsNotification
{
    public function __construct(
        protected Complaint $complaint,
        protected string $status
    ) {}

    public function notificationCategory(): string
    {
        return 'complaints';
    }

    public function notificationSubject(): string
    {
        return 'Complaint update: ' . ucfirst(str_replace('_', ' ', $this->status));
    }

    public function notificationLines(): array
    {
        return [
            'Your complaint "' . $this->complaint->subject . '" status is now: ' . ucfirst(str_replace('_', ' ', $this->status)) . '.',
        ];
    }

    public function actionUrl(): ?string
    {
        return route('complaints.index');
    }

    public function actionLabel(): string
    {
        return 'View complaints';
    }
}
