<?php

namespace App\Jobs;

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

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

    public function __construct(public bool $force = false)
    {
    }

    public function handle(ReportScheduleRunner $runner): void
    {
        $runner->runDue($this->force);
    }
}
