update fix deadcode, security

This commit is contained in:
baodev0
2026-09-28 08:26:29 +07:00
parent 3af59bd9c5
commit 82080b5b84
452 changed files with 4857 additions and 26289 deletions
@@ -5,7 +5,6 @@ namespace App\Services\Customer;
use App\Models\Invoice;
use App\Models\Order;
use App\Models\Transaction;
use App\Repositories\Customer\CustomerRepositoryInterface;
use App\Repositories\Invoice\InvoiceRepositoryInterface;
use App\Repositories\Order\OrderRepositoryInterface;
use App\Repositories\Transaction\TransactionRepositoryInterface;
@@ -17,7 +16,6 @@ class CustomerBillingService
use ResolvesCustomer;
public function __construct(
private readonly CustomerRepositoryInterface $customerRepository,
private readonly InvoiceRepositoryInterface $invoiceRepository,
private readonly TransactionRepositoryInterface $transactionRepository,
private readonly OrderRepositoryInterface $orderRepository,
@@ -5,7 +5,6 @@ namespace App\Services\Customer;
use App\Http\Resources\Api\Client\ClientResource;
use App\Models\Log;
use App\Models\User;
use App\Repositories\Customer\CustomerRepositoryInterface;
use App\Services\Api\Client\ClientAuthService;
use App\Services\Customer\Concerns\ResolvesCustomer;
use Illuminate\Http\Request;
@@ -20,7 +19,6 @@ class CustomerImpersonationService
private const TTL_SECONDS = 120;
public function __construct(
private readonly CustomerRepositoryInterface $customerRepository,
private readonly ClientAuthService $clientAuthService,
) {}
@@ -3,7 +3,6 @@
namespace App\Services\Customer;
use App\Models\Note;
use App\Repositories\Customer\CustomerRepositoryInterface;
use App\Services\Customer\Concerns\ResolvesCustomer;
use Illuminate\Support\Collection;
@@ -11,10 +10,6 @@ class CustomerNoteService
{
use ResolvesCustomer;
public function __construct(
private readonly CustomerRepositoryInterface $customerRepository,
) {}
/**
* Ghi chú của khách hàng (không gắn với dịch vụ cụ thể).
*/
@@ -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;
});
}
}