feat: implement IP pool management module with CRUD operations and network integration

This commit is contained in:
pbao9
2026-05-13 11:02:28 +07:00
parent 7311a20324
commit 1bbba4e158
3 changed files with 286 additions and 0 deletions
@@ -4,6 +4,7 @@ declare(strict_types=1);
namespace App\Jobs\VirtualMachine\Provision;
use App\Jobs\Mail\Admin\AdminOrderNotificationJob;
use App\Jobs\Mail\SendInformationVirtualMachine;
use App\Models\Invoice;
use App\Models\ModuleVmware;
@@ -112,6 +113,27 @@ class SendVmCredentialsEmailJob implements ShouldQueue
'ip' => $vm->ip,
'invoice_attached' => $invoicePdf !== null,
]);
// Notify admin with VM credentials after successful provisioning
$order = $vm->order;
AdminOrderNotificationJob::dispatch([
'customer_name' => trim($customer->firstname . ' ' . $customer->lastname),
'customer_email' => $customer->email,
'client_ip' => null,
'order_num' => $order?->order_num ?? $order?->id ?? 'N/A',
'product_name' => $orderItem?->getProductAttribute()?->name ?? 'Cloud VPS',
'product_type' => 'Cloud VPS',
'billing_cycle' => $this->billingLabel($months),
'total' => $orderItem?->price ?? 0,
'created_at' => $order?->created_at?->format('d/m/Y H:i:s') ?? now()->format('d/m/Y H:i:s'),
'ip' => $vm->ip ?? '',
'username' => $vm->user ?? '',
'password' => $vm->plain_password ?? '',
]);
Log::info('SendVmCredentialsEmailJob: admin notification dispatched', [
'module_vmware_id' => $this->moduleVmwareId,
]);
}
public function failed(\Throwable $e): void