feat: Enhance service management and transaction handling
- Implemented client access token verification middleware to secure API endpoints. - Updated ServiceController to fetch active hosting services for authenticated users. - Refactored OrderController to ensure order retrieval is customer-specific. - Improved error logging in VmController for unexpected vCenter responses. - Disabled VNPay auto-deposit in TransactionController, switching to manual deposit flow. - Enhanced ServiceClientDetailResource to include Plesk credentials for hosting accounts. - Adjusted VpsServiceResource to dynamically set page type based on product type. - Added logging for PowerShellService to capture errors in RDP port changes. - Provisioning job now resolves service plans and logs relevant information for hosting accounts. - Updated database migrations to add necessary fields for service plans and DNS servers. - Refactored Service and ServicePlan models to establish relationships with hosting accounts and DNS servers.
This commit is contained in:
@@ -138,6 +138,7 @@ class DomainOrderService
|
||||
$service = Service::create([
|
||||
'customer_id' => $lockedCustomer->id,
|
||||
'product_id' => $product->id,
|
||||
'type' => ProductTypeEnums::DOMAIN->value,
|
||||
'order_item_id' => $orderItem->id,
|
||||
'invoice_id' => $invoice->id,
|
||||
'server_name' => $domainName,
|
||||
|
||||
@@ -157,6 +157,7 @@ class OrderService
|
||||
$service = Service::create([
|
||||
'customer_id' => $customer->id,
|
||||
'product_id' => $item->product_id,
|
||||
'type' => $item->product?->product_type,
|
||||
'order_item_id' => $item->id,
|
||||
'invoice_id' => $invoice?->id,
|
||||
'server_name' => $item->server_name,
|
||||
|
||||
@@ -10,6 +10,7 @@ use App\Models\DnsServer;
|
||||
use App\Models\ModuleHostingAccount;
|
||||
use App\Repositories\DnsManager\Domain\DnsDomainRepositoryInterface;
|
||||
use App\Repositories\Module\HostingAccount\HostingAccountRepositoryInterface;
|
||||
use Illuminate\Support\Str;
|
||||
|
||||
/**
|
||||
* Phase 1 orchestration: Create Customer -> Create Hosting Subscription ->
|
||||
@@ -54,7 +55,8 @@ class PleskHostingService
|
||||
$pleskLogin = $client['data']['login'];
|
||||
$pleskPassword = $client['data']['password'];
|
||||
|
||||
$ftpLogin = str_replace('.', '_', $data['domain_name']);
|
||||
// Suffix avoids a collision if the same domain is re-provisioned (e.g. after cancellation).
|
||||
$ftpLogin = str_replace('.', '_', $data['domain_name']) . '_' . Str::lower(Str::random(4));
|
||||
// Not persisted anywhere — the only record of it is this response, once.
|
||||
$ftpPassword = $data['ftp_password'] ?? Helper::general_password();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user