<?php

namespace App\Jobs;

use App\Services\NotificationService;
use Illuminate\Bus\Queueable;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Foundation\Bus\Dispatchable;
use Illuminate\Queue\InteractsWithQueue;
use Illuminate\Queue\SerializesModels;

class SendGeneralNotificationJob implements ShouldQueue
{
    use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;

    public function __construct(
        public string $title,
        public string $message,
        public array $memberIds = [],
        public array $coachIds = []
    ) {}

    public function handle(NotificationService $notificationService): void
    {
        $notificationService->sendGeneralNotificationToRecipients(
            $this->title,
            $this->message,
            $this->memberIds,
            $this->coachIds
        );
    }
}

