feat(vm): hoàn tiền khi cấp VM lỗi, theo dõi job queue, uuid dịch vụ cho ticket, chuẩn hoá RAM addon

- VmProvisionException/VmProvisionRefund xử lý lỗi cấp phát VM
- QueueJobInspector + QueueMonitorController xem chi tiết job
- Thêm service uuid cho ticket, thời lượng cho activity_logs
- Migration chuẩn hoá RAM addon sang MB, trạng thái deleting cho snapshot

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
baodev0
2026-10-30 11:54:05 +07:00
co-authored by Claude Sonnet 5.5
parent 7136bec265
commit 62596d9063
32 changed files with 514 additions and 107 deletions
+6
View File
@@ -3,6 +3,7 @@
namespace App\Services;
use App\Jobs\LogActivityJob;
use Carbon\CarbonInterface;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Support\Facades\Log;
@@ -25,6 +26,8 @@ class ActivityLogger
?Model $subject = null,
array $oldValues = [],
array $newValues = [],
?CarbonInterface $startedAt = null,
?CarbonInterface $finishedAt = null,
): void {
try {
[$causerType, $causerId, $causerName] = $this->resolveCauser();
@@ -42,6 +45,9 @@ class ActivityLogger
'new_values' => $newValues ?: null,
'ip_address' => request()->getClientIp(),
'user_agent' => request()->userAgent(),
'started_at' => $startedAt?->format('Y-m-d H:i:s.v'),
'finished_at' => $finishedAt?->format('Y-m-d H:i:s.v'),
'created_at' => now()->format('Y-m-d H:i:s.v'),
]);
} catch (\Throwable $e) {
Log::warning('[ActivityLogger] Failed to dispatch log job', [