<?php

namespace App\Notifications;

use App\Models\Complaint;

class ComplaintFiledAgainstYouNotification extends HrmsNotification
{
    public function __construct(
        protected Complaint $complaint
    ) {}

    public function notificationCategory(): string
    {
        return 'complaints';
    }

    public function notificationSubject(): string
    {
        return 'A complaint has been recorded concerning you';
    }

    public function notificationLines(): array
    {
        return [
            'HR has recorded a complaint that lists you as the subject.',
            'You can see your complaint count on the Complaints page.',
            'Complaint details are only visible to Admin, HR, and Managers.',
        ];
    }

    public function actionUrl(): ?string
    {
        return route('my-hr-records.index') . '#complaints-against';
    }

    public function actionLabel(): string
    {
        return 'View my records';
    }

    public function toArray(object $notifiable): array
    {
        return [
            'type' => 'complaint_against_you',
            'message' => 'A complaint has been recorded concerning you.',
            'complaint_id' => $this->complaint->id,
            'url' => route('my-hr-records.index') . '#complaints-against',
        ];
    }
}
