Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
0.00% covered (danger)
0.00%
0 / 7
0.00% covered (danger)
0.00%
0 / 2
CRAP
0.00% covered (danger)
0.00%
0 / 1
ReconcileNuvemshopOrdersJob
0.00% covered (danger)
0.00%
0 / 7
0.00% covered (danger)
0.00%
0 / 2
6
0.00% covered (danger)
0.00%
0 / 1
 __construct
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
 handle
0.00% covered (danger)
0.00%
0 / 6
0.00% covered (danger)
0.00%
0 / 1
2
1<?php
2
3namespace App\Jobs;
4
5use App\Models\StoreIntegration;
6use Illuminate\Contracts\Queue\ShouldQueue;
7use Illuminate\Foundation\Queue\Queueable;
8
9class ReconcileNuvemshopOrdersJob implements ShouldQueue
10{
11    use Queueable;
12
13    public function __construct(public int $integrationId, public int $days = 30)
14    {
15    }
16
17    public function handle(): void
18    {
19        $integration = StoreIntegration::findOrFail($this->integrationId);
20        SyncNuvemshopOrdersJob::dispatchSync(
21            $integration->id,
22            now()->subDays($this->days)->toDateTimeString(),
23            now()->toDateTimeString(),
24        );
25    }
26}