2026-08-24 21:06:11 +03:00
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
namespace Modules\Core\Privacy\Jobs;
|
|
|
|
|
|
|
|
|
|
use Illuminate\Bus\Queueable;
|
|
|
|
|
use Illuminate\Contracts\Queue\ShouldQueue;
|
|
|
|
|
use Illuminate\Foundation\Bus\Dispatchable;
|
|
|
|
|
use Illuminate\Queue\InteractsWithQueue;
|
|
|
|
|
use Illuminate\Queue\SerializesModels;
|
|
|
|
|
use Modules\Core\Privacy\Models\DataErasureRequest;
|
2026-09-16 01:21:22 +03:00
|
|
|
use Modules\Core\Privacy\Services\PrivacyService;
|
2026-08-24 21:06:11 +03:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Runs PrivacyService::completeErasure() for one due DataErasureRequest, dispatched
|
|
|
|
|
* per-request by ProcessErasureRequestsCommand rather than looping over
|
|
|
|
|
* completeErasure() calls inline in the command. One job per request means one
|
|
|
|
|
* request's failure (a provider throwing, a DB error) doesn't block or crash
|
|
|
|
|
* processing of the others, and Laravel's normal per-job retry/failure handling
|
|
|
|
|
* applies to each request independently.
|
|
|
|
|
*/
|
|
|
|
|
class EraseDataSubjectJob implements ShouldQueue
|
|
|
|
|
{
|
|
|
|
|
use Dispatchable;
|
|
|
|
|
use InteractsWithQueue;
|
|
|
|
|
use Queueable;
|
|
|
|
|
use SerializesModels;
|
|
|
|
|
|
|
|
|
|
public function __construct(
|
|
|
|
|
public readonly DataErasureRequest $request,
|
|
|
|
|
) {}
|
|
|
|
|
|
|
|
|
|
public function handle(PrivacyService $privacyService): void
|
|
|
|
|
{
|
|
|
|
|
$privacyService->completeErasure($this->request);
|
|
|
|
|
}
|
|
|
|
|
}
|