Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
Total | |
0.00% |
0 / 5 |
|
0.00% |
0 / 4 |
CRAP | |
0.00% |
0 / 1 |
ProcessSubscriptionAsyncJob | |
0.00% |
0 / 5 |
|
0.00% |
0 / 4 |
20 | |
0.00% |
0 / 1 |
__construct | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
handle | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
backoff | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
created | |
0.00% |
0 / 2 |
|
0.00% |
0 / 1 |
2 |
1 | <?php |
2 | |
3 | namespace App\Jobs; |
4 | |
5 | use Illuminate\Bus\Queueable; |
6 | use Illuminate\Contracts\Queue\ShouldQueue; |
7 | use Illuminate\Foundation\Bus\Dispatchable; |
8 | use Illuminate\Queue\InteractsWithQueue; |
9 | use Illuminate\Queue\SerializesModels; |
10 | use App\Http\Models\UserInfo; |
11 | use App\Http\Models\Auth\User; |
12 | use App\Http\Models\Plans; |
13 | use App\Http\Models\Subscription; |
14 | use App\Services\UserInfo\SubscriptionService; |
15 | use App\Traits\ObjectMapper; |
16 | use Carbon\Carbon; |
17 | use Illuminate\Support\Facades\Log; |
18 | use Illuminate\Support\Str; |
19 | |
20 | class ProcessSubscriptionAsyncJob implements ShouldQueue |
21 | { |
22 | use Dispatchable, InteractsWithQueue, Queueable, SerializesModels, ObjectMapper; |
23 | |
24 | public $tries = 5; |
25 | |
26 | public function __construct(public Subscription $subscription) {} |
27 | |
28 | public function handle(): void |
29 | { |
30 | $this->created($this->subscription); |
31 | } |
32 | |
33 | public function backoff() |
34 | { |
35 | return [10, 30, 60, 120, 300]; |
36 | } |
37 | |
38 | private function created(Subscription $subscription): void |
39 | { |
40 | $subscriptionService = new SubscriptionService(); |
41 | |
42 | $subscriptionService->created($subscription); |
43 | } |
44 | } |