update fix deadcode, security
This commit is contained in:
@@ -1,7 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace app\Services\Api\Client;
|
||||
|
||||
class ClientService{
|
||||
|
||||
}
|
||||
@@ -7,7 +7,6 @@ namespace App\Services\Api\Order;
|
||||
use App\DTOs\Order\ClientOrderFilters;
|
||||
use App\Enums\Invoice\InvoiceStatus;
|
||||
use App\Helpers\OrderHelper;
|
||||
use App\Jobs\VirtualMachine\Action\VMJobs;
|
||||
use App\Jobs\VirtualMachine\Provision\RetryProvisioningOrchestrator;
|
||||
use App\Models\Invoice;
|
||||
use App\Models\ModuleVmware;
|
||||
@@ -15,7 +14,7 @@ use App\Models\Order;
|
||||
use App\Models\OrderItem;
|
||||
use App\Models\Service;
|
||||
use App\Models\VirtualMachines;
|
||||
use App\Repositories\Api\Order\OrderRepository;
|
||||
use App\Repositories\Api\Order\OrderRepositoryInterface;
|
||||
use App\Repositories\Api\Service\ServiceRepositoryInterface;
|
||||
use App\Support\RenewalPricing;
|
||||
use Carbon\Carbon;
|
||||
@@ -25,7 +24,7 @@ use Illuminate\Support\Facades\DB;
|
||||
class OrderQueryService
|
||||
{
|
||||
public function __construct(
|
||||
private readonly OrderRepository $orderRepository,
|
||||
private readonly OrderRepositoryInterface $orderRepository,
|
||||
private readonly ServiceRepositoryInterface $productRepo,
|
||||
) {
|
||||
}
|
||||
@@ -128,26 +127,6 @@ class OrderQueryService
|
||||
->get();
|
||||
}
|
||||
|
||||
public function findCustomerService(int $customerId, string $uuid): ?Service
|
||||
{
|
||||
return Service::query()
|
||||
->with(['product', 'addons', 'invoice', 'orderItem', 'vmware.ipAddress', 'vmware.os', 'vmware.vCenter'])
|
||||
->where('uuid', $uuid)
|
||||
->where('customer_id', $customerId)
|
||||
->first();
|
||||
}
|
||||
|
||||
public function canRetryProvisioning(Service $service): bool
|
||||
{
|
||||
if ($service->status !== 'pending' || $service->retry_requested_at) {
|
||||
return false;
|
||||
}
|
||||
|
||||
$paidAt = $service->invoice?->paid_at;
|
||||
|
||||
return $paidAt ? Carbon::parse($paidAt)->diffInMinutes(now()) >= 180 : false;
|
||||
}
|
||||
|
||||
public function retryProvisioning(Order $order, int $customerId): array
|
||||
{
|
||||
$order = Order::where('id', $order->id)
|
||||
|
||||
@@ -7,8 +7,8 @@ use App\Helpers\OrderHelper;
|
||||
use App\Jobs\Mail\Admin\AdminOrderNotificationJob;
|
||||
use App\Models\Order;
|
||||
use App\Models\Product;
|
||||
use App\Repositories\Api\Invoice\InvoiceRepository;
|
||||
use App\Repositories\Api\Order\OrderRepository;
|
||||
use App\Repositories\Api\Invoice\InvoiceRepositoryInterface;
|
||||
use App\Repositories\Api\Order\OrderRepositoryInterface;
|
||||
use App\Repositories\Api\Service\ServiceRepository;
|
||||
use App\Services\InvoicePaymentService;
|
||||
use App\Support\AddonQuantityValidator;
|
||||
@@ -19,9 +19,9 @@ use Illuminate\Support\Facades\Log;
|
||||
class OrderService
|
||||
{
|
||||
public function __construct(
|
||||
protected OrderRepository $orderRepo,
|
||||
protected OrderRepositoryInterface $orderRepo,
|
||||
protected ServiceRepository $productRepo,
|
||||
protected InvoiceRepository $invoiceRepo,
|
||||
protected InvoiceRepositoryInterface $invoiceRepo,
|
||||
protected InvoicePaymentService $invoicePaymentService,
|
||||
) {}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user