update fix deadcode, security
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user