Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
100.00% |
2 / 2 |
|
100.00% |
2 / 2 |
CRAP | |
100.00% |
1 / 1 |
| ScanPortalDocumentJob | |
100.00% |
2 / 2 |
|
100.00% |
2 / 2 |
2 | |
100.00% |
1 / 1 |
| __construct | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| handle | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| 1 | <?php |
| 2 | |
| 3 | declare(strict_types=1); |
| 4 | |
| 5 | namespace ImovelZapAi\ClientPortal\Infrastructure\Jobs; |
| 6 | |
| 7 | use Illuminate\Bus\Queueable; |
| 8 | use Illuminate\Contracts\Queue\ShouldQueue; |
| 9 | use Illuminate\Foundation\Bus\Dispatchable; |
| 10 | use Illuminate\Queue\InteractsWithQueue; |
| 11 | use Illuminate\Queue\SerializesModels; |
| 12 | use ImovelZapAi\ClientPortal\Application\Actions\CompleteDocumentScanAction; |
| 13 | |
| 14 | final 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 | } |