use Illuminate\Bus\Queueable;
use Illuminate\Queue\SerializesModels;
use App\Services\Logs\LogAccountAction;
use Illuminate\Queue\InteractsWithQueue;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Foundation\Bus\Dispatchable;
class LogAccountAudit implements ShouldQueue
{
use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;
public array $auditLog;
public function __construct(array $auditLog)
{
$this->auditLog = $auditLog;
}
public function handle(): void
{
(new LogAccountAction)->execute([
'company_id' => $this->auditLog['company_id'],
'author_id' => $this->auditLog['author_id'],
'author_name' => $this->auditLog['author_name'],
'audited_at' => $this->auditLog['audited_at'],
'action' => $this->auditLog['action'],
'objects' => $this->auditLog['objects'],
]);
}
}