feat: Implement payment method fields, refactor order creation logic to support detailed order items and VM provisioning, and add admin notifications.

This commit is contained in:
pbao9
2026-03-11 10:14:32 +07:00
parent 7fdcc01027
commit 5649674eb4
9 changed files with 208 additions and 61 deletions
@@ -285,6 +285,22 @@ class CreateVirtualMachineJob implements ShouldQueue
]
);
$this->writeCustomerSuccessLog();
try {
$order = $this->item->order;
$customer = $order->customer;
broadcast(new \App\Events\OrderProvisioned(
orderId: $order->id,
orderNum: $order->order_num,
customerName: trim($customer->firstname . ' ' . $customer->lastname),
vmId: (string) $vmId,
success: true,
message: 'Máy ảo đã được khởi tạo thành công cho khách hàng ' . trim($customer->firstname . ' ' . $customer->lastname) . ' (Đơn #' . $order->order_num . ')',
));
} catch (\Throwable $e) {
Log::warning('Không thể broadcast OrderProvisioned: ' . $e->getMessage());
}
return true;
}