<?php

declare(strict_types=1);

namespace App\Jobs;

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

class RecalculateArtworkMedalStatsJob implements ShouldQueue
{
    use Dispatchable;
    use InteractsWithQueue;
    use Queueable;
    use SerializesModels;

    public function __construct(public readonly int $artworkId)
    {
    }

    public function handle(ArtworkMedalService $medals): void
    {
        $medals->refreshArtworkMedalState($this->artworkId);
    }
}