<?php

namespace App\Services\Notifications;

use App\Models\Notification;

class NotificationDeletedService
{
    public function list(): array
    {
        $rows = Notification::getDeletedNotifications();

        $notifications = array_map(static function ($row) {
            return [
                'id' => $row['id'] ?? null,
                'title' => $row['title'] ?? null,
                'message' => $row['message'] ?? null,
                'priority' => $row['priority'] ?? null,
                'scheduled_at' => $row['scheduled_at'] ?? null,
                'expires_at' => $row['expires_at'] ?? null,
                'deleted_at' => $row['deleted_at'] ?? null,
            ];
        }, $rows ?? []);

        return ['notifications' => $notifications];
    }
}
