feat(admin): improve payments and server settings
This commit is contained in:
@@ -5,6 +5,7 @@ declare(strict_types=1);
|
||||
namespace App\Jobs\VirtualMachine\Rebuild;
|
||||
|
||||
use App\Http\Services\Telegram;
|
||||
use App\Enums\Product\ProductBillingCycle;
|
||||
use App\Jobs\Mail\Admin\AdminOrderNotificationJob;
|
||||
use App\Jobs\Mail\Customer\VmRebuildFailedJob;
|
||||
use App\Jobs\Mail\SendInformationVirtualMachine;
|
||||
@@ -157,7 +158,7 @@ final class RebuildFinalizeJob implements ShouldQueue
|
||||
'company_logo' => $settingValue->logo ?? '',
|
||||
'client_name' => $vm->customer->fullname ?? '',
|
||||
'product_name' => $orderItem?->getProductAttribute()?->name ?? 'Cloud VPS',
|
||||
'product_billing' => $this->billingLabel($months),
|
||||
'product_billing' => ProductBillingCycle::vietnameseLabelForMonths($months),
|
||||
'product_price' => $orderItem ? number_format((float) $orderItem->price, 0, ',', '.') : 'N/A',
|
||||
'service_host' => $vm->ip ?? 'N/A',
|
||||
'service_username' => $osUsername,
|
||||
@@ -180,7 +181,7 @@ final class RebuildFinalizeJob implements ShouldQueue
|
||||
'order_num' => $vm->order?->order_num ?? $vm->order?->id ?? 'N/A',
|
||||
'product_name' => ($orderItem?->getProductAttribute()?->name ?? 'Cloud VPS') . ' (Rebuild)',
|
||||
'product_type' => 'Cloud VPS Rebuild',
|
||||
'billing_cycle' => $this->billingLabel($months),
|
||||
'billing_cycle' => ProductBillingCycle::vietnameseLabelForMonths($months),
|
||||
'total' => $orderItem?->price ?? 0,
|
||||
'created_at' => now()->format('d/m/Y H:i:s'),
|
||||
'ip' => $vm->ip ?? '',
|
||||
@@ -188,17 +189,4 @@ final class RebuildFinalizeJob implements ShouldQueue
|
||||
'password' => $vm->plain_password ?? '',
|
||||
]);
|
||||
}
|
||||
|
||||
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 . ' Thang',
|
||||
};
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user