update fix deadcode, security
This commit is contained in:
@@ -16,7 +16,6 @@ use App\Models\Product;
|
||||
use App\Models\Service;
|
||||
use App\Models\Transaction;
|
||||
use App\Models\VirtualMachines;
|
||||
use App\Repositories\Customer\CustomerRepositoryInterface;
|
||||
use App\Repositories\Module\Hosting\HostingRepositoryInterface as ModuleHostingRepositoryInterface;
|
||||
use App\Repositories\Module\Vmware\VmwareRepositoryInterface;
|
||||
use App\Repositories\Service\ServiceRepositoryInterface;
|
||||
@@ -33,45 +32,11 @@ class CustomerServiceProvisioningService
|
||||
use ResolvesCustomer;
|
||||
|
||||
public function __construct(
|
||||
private readonly CustomerRepositoryInterface $customerRepository,
|
||||
private readonly ModuleHostingRepositoryInterface $moduleHostingRepository,
|
||||
private readonly VmwareRepositoryInterface $vmwareRepository,
|
||||
private readonly ServiceRepositoryInterface $serviceRepository,
|
||||
) {}
|
||||
|
||||
public function getProducts(string $uuid): Collection
|
||||
{
|
||||
$customer = $this->resolveCustomer($uuid);
|
||||
|
||||
$hostingServices = $this->moduleHostingRepository->filter(['customer_id' => $customer->id], ['server']);
|
||||
$vpsServices = $this->vmwareRepository->filter(
|
||||
['customer_id' => $customer->id],
|
||||
['ipaddress.host.datacenter.vCenter', 'os.osGroup'],
|
||||
);
|
||||
|
||||
$allService = collect();
|
||||
|
||||
foreach ($hostingServices as $hosting) {
|
||||
$allService->push([
|
||||
'product_id' => $hosting->id,
|
||||
'product_type' => 3,
|
||||
'name' => $hosting->name,
|
||||
'description' => $hosting->name . ' (Hosting)',
|
||||
]);
|
||||
}
|
||||
|
||||
foreach ($vpsServices as $vps) {
|
||||
$allService->push([
|
||||
'product_id' => $vps->id,
|
||||
'product_type' => 4,
|
||||
'name' => $vps->name,
|
||||
'description' => $vps->name . ' (VPS)',
|
||||
]);
|
||||
}
|
||||
|
||||
return $allService->values();
|
||||
}
|
||||
|
||||
public function getServices(string $uuid): Collection
|
||||
{
|
||||
$services = $this->serviceRepository->filter(
|
||||
@@ -397,5 +362,4 @@ class CustomerServiceProvisioningService
|
||||
return $vm;
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user