Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
0.00% |
0 / 9 |
|
0.00% |
0 / 4 |
CRAP | |
0.00% |
0 / 1 |
| RunBackgroundProcessJob | |
0.00% |
0 / 9 |
|
0.00% |
0 / 4 |
20 | |
0.00% |
0 / 1 |
| __construct | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| getProcessId | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| getBoundedContextId | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| handle | |
0.00% |
0 / 6 |
|
0.00% |
0 / 1 |
2 | |||
| 1 | <?php |
| 2 | namespace Apie\LaravelApie\Wrappers\Queue; |
| 3 | |
| 4 | use Apie\Core\BackgroundProcess\SequentialBackgroundProcessIdentifier; |
| 5 | use Apie\Core\BackgroundProcess\Utils; |
| 6 | use Apie\Core\BoundedContext\BoundedContextId; |
| 7 | use Apie\Core\ContextBuilders\ContextBuilderFactory; |
| 8 | use Apie\Core\Datalayers\ApieDatalayer; |
| 9 | use Illuminate\Contracts\Queue\ShouldQueue; |
| 10 | use Illuminate\Foundation\Queue\Queueable; |
| 11 | |
| 12 | class RunBackgroundProcessJob implements ShouldQueue |
| 13 | { |
| 14 | use Queueable; |
| 15 | |
| 16 | public function __construct( |
| 17 | private SequentialBackgroundProcessIdentifier $processId, |
| 18 | private ?BoundedContextId $boundedContextId = null, |
| 19 | ) { |
| 20 | } |
| 21 | |
| 22 | public function getProcessId(): SequentialBackgroundProcessIdentifier |
| 23 | { |
| 24 | return $this->processId; |
| 25 | } |
| 26 | |
| 27 | public function getBoundedContextId(): ?BoundedContextId |
| 28 | { |
| 29 | return $this->boundedContextId; |
| 30 | } |
| 31 | |
| 32 | public function handle( |
| 33 | ApieDatalayer $apieDatalayer, |
| 34 | ContextBuilderFactory $contextBuilderFactory |
| 35 | ): void { |
| 36 | Utils::runBackgroundProcess( |
| 37 | $this->getProcessId(), |
| 38 | $this->getBoundedContextId(), |
| 39 | $apieDatalayer, |
| 40 | $contextBuilderFactory |
| 41 | ); |
| 42 | } |
| 43 | } |