Feature: Creating Privacy Basics
This commit is contained in:
@@ -0,0 +1,36 @@
|
||||
<?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;
|
||||
use Modules\Core\Privacy\PrivacyService;
|
||||
|
||||
/**
|
||||
* 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);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user