Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
100.00% covered (success)
100.00%
2 / 2
100.00% covered (success)
100.00%
2 / 2
CRAP
100.00% covered (success)
100.00%
1 / 1
ScanPortalDocumentJob
100.00% covered (success)
100.00%
2 / 2
100.00% covered (success)
100.00%
2 / 2
2
100.00% covered (success)
100.00%
1 / 1
 __construct
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 handle
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
1<?php
2
3declare(strict_types=1);
4
5namespace ImovelZapAi\ClientPortal\Infrastructure\Jobs;
6
7use Illuminate\Bus\Queueable;
8use Illuminate\Contracts\Queue\ShouldQueue;
9use Illuminate\Foundation\Bus\Dispatchable;
10use Illuminate\Queue\InteractsWithQueue;
11use Illuminate\Queue\SerializesModels;
12use ImovelZapAi\ClientPortal\Application\Actions\CompleteDocumentScanAction;
13
14final class ScanPortalDocumentJob implements ShouldQueue
15{
16    use Dispatchable;
17    use InteractsWithQueue;
18    use Queueable;
19    use SerializesModels;
20
21    public int $tries = 2;
22
23    public function __construct(
24        public readonly string $uploadedDocumentId,
25    ) {
26        $this->onQueue((string) config('client_portal.queue', 'client-portal'));
27    }
28
29    public function handle(CompleteDocumentScanAction $action): void
30    {
31        // Stub: integração real de antivírus em sprint futuro.
32        $action->execute($this->uploadedDocumentId, infected: false);
33    }
34}