feat(admin): improve payments and server settings

This commit is contained in:
baodev0
2026-10-19 07:59:23 +07:00
parent 9ed77a85fd
commit ea9a53f742
32 changed files with 680 additions and 78 deletions
@@ -5,6 +5,7 @@ declare(strict_types=1);
namespace App\Jobs\VirtualMachine\Provision;
use App\Http\Services\Telegram;
use App\Enums\Product\ProductBillingCycle;
use App\Jobs\Mail\Admin\AdminOrderNotificationJob;
use App\Jobs\Mail\SendInformationVirtualMachine;
use App\Models\Invoice;
@@ -97,7 +98,7 @@ class SendVmCredentialsEmailJob implements ShouldQueue
'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),
'billing_cycle' => ProductBillingCycle::vietnameseLabelForMonths($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 ?? '',
@@ -171,15 +172,4 @@ class SendVmCredentialsEmailJob implements ShouldQueue
// ─────────────────────────────────────────────────────────────────────────
private function billingLabel(?int $months): string
{
return match ($months) {
1 => 'Hang thang',
3 => '3 Thang',
6 => '6 Thang',
12 => 'Hang nam',
24 => '2 Nam',
default => ($months ?? 0) . ' Thang',
};
}
}