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:
baodev0
2026-08-17 11:55:48 +07:00
parent b03ee9fc2d
commit 2deb4ad74e
28 changed files with 489 additions and 229 deletions
@@ -0,0 +1,31 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
public function up(): void
{
Schema::table('services', function (Blueprint $table) {
$table->string('type', 50)->nullable()->after('product_id')->index();
});
// Backfill existing rows from products.product_type (vps / hosting / domain / ...).
DB::statement(<<<'SQL'
UPDATE services
JOIN products ON products.id = services.product_id
SET services.type = products.product_type
WHERE services.type IS NULL
SQL);
}
public function down(): void
{
Schema::table('services', function (Blueprint $table) {
$table->dropColumn('type');
});
}
};
@@ -0,0 +1,23 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
public function up(): void
{
Schema::table('service_plans', function (Blueprint $table) {
$table->foreignId('dns_manager_server_id')->nullable()->after('domain')
->constrained('dns_manager_servers')->nullOnDelete();
});
}
public function down(): void
{
Schema::table('service_plans', function (Blueprint $table) {
$table->dropConstrainedForeignId('dns_manager_server_id');
});
}
};
@@ -0,0 +1,22 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
public function up(): void
{
Schema::table('dns_manager_servers', function (Blueprint $table) {
$table->unsignedInteger('panel_port')->default(8880)->after('ip_address');
});
}
public function down(): void
{
Schema::table('dns_manager_servers', function (Blueprint $table) {
$table->dropColumn('panel_port');
});
}
};