Fix missing platform column in admin placeOrder
Maps vps->virtfusion, dedicated->synergycp, hosting->enhance, game->pterodactyl consistent with ProvisioningFactory routing. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -321,12 +321,21 @@ class CustomerController extends Controller
|
|||||||
'admin_notes' => 'Order placed by admin',
|
'admin_notes' => 'Order placed by admin',
|
||||||
]);
|
]);
|
||||||
|
|
||||||
|
// Map service type to provisioning platform
|
||||||
|
$platformMap = [
|
||||||
|
'vps' => 'virtfusion',
|
||||||
|
'dedicated' => 'synergycp',
|
||||||
|
'hosting' => 'enhance',
|
||||||
|
'game' => 'pterodactyl',
|
||||||
|
];
|
||||||
|
|
||||||
// Create service
|
// Create service
|
||||||
$service = Service::query()->create([
|
$service = Service::query()->create([
|
||||||
'user_id' => $user->id,
|
'user_id' => $user->id,
|
||||||
'plan_id' => $plan->id,
|
'plan_id' => $plan->id,
|
||||||
'order_id' => $order->id,
|
'order_id' => $order->id,
|
||||||
'service_type' => $plan->service_type,
|
'service_type' => $plan->service_type,
|
||||||
|
'platform' => $platformMap[$plan->service_type] ?? $plan->service_type,
|
||||||
'status' => 'active',
|
'status' => 'active',
|
||||||
'credentials' => [],
|
'credentials' => [],
|
||||||
]);
|
]);
|
||||||
|
|||||||
Reference in New Issue
Block a user