<?php

namespace App\Jobs;

use App\Services\Meta\MetaCampaignSafetyAuditService;
use Illuminate\Bus\Queueable;
use Illuminate\Contracts\Queue\ShouldBeUnique;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Foundation\Bus\Dispatchable;
use Illuminate\Queue\InteractsWithQueue;
use Illuminate\Queue\SerializesModels;

class AuditMetaCampaignSafetyJob implements ShouldQueue, ShouldBeUnique
{
    use Dispatchable;
    use InteractsWithQueue;
    use Queueable;
    use SerializesModels;

    public int $tries = 2;
    public int $timeout = 900;
    public int $uniqueFor = 3600;

    public function handle(MetaCampaignSafetyAuditService $service): void
    {
        $service->audit();
    }

    public function uniqueId(): string
    {
        return 'meta-campaign-safety-audit';
    }
}
