feat: nhắc gia hạn QR theo dịch vụ, failover server hosting, CCCD admin, log cấp phát dịch vụ

- Mail campaign: mẫu nhắc gia hạn thanh toán QR, chọn dịch vụ + chu kỳ từng dòng (renewal_services)
- Hosting: nhiều server Plesk cho một gói (service_plan_servers), chuyển server khi server chết
- Admin xem/sửa giấy tờ định danh khách, tuỳ chọn gia hạn cho khách, nhật ký cấp phát dịch vụ
- Đánh dấu mẫu email dịch vụ là non-marketing

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
baodev0
2026-10-30 18:36:41 +07:00
co-authored by Claude Sonnet 5.5
parent 047c23beff
commit 55a834a2f8
53 changed files with 1463 additions and 119 deletions
+17
View File
@@ -14,6 +14,7 @@ use App\Repositories\Api\Service\ServiceRepository;
use App\Services\InvoicePaymentService;
use App\Services\AdminPaymentNotifier;
use App\Services\Coupon\CouponService;
use App\Services\Hosting\HostingServerSelector;
use App\Services\VirtualMachine\VmIpReservationService;
use App\Support\AddonQuantityValidator;
use Illuminate\Support\Facades\DB;
@@ -28,6 +29,7 @@ class OrderService
protected AdminPaymentNotifier $adminPaymentNotifier,
protected CouponService $couponService,
protected VmIpReservationService $vmIpReservation,
protected HostingServerSelector $hostingServers,
) {}
// =========================================================================
@@ -116,6 +118,21 @@ class OrderService
if ($needsVm && !$this->vmIpReservation->hasFreeIp()) {
throw new \InvalidArgumentException('Hiện tại hạ tầng đang đầy vui lòng liên hệ quản trị viên');
}
$this->assertHostingServerAvailable($products);
}
private function assertHostingServerAvailable(iterable $products): void
{
foreach ($products as $product) {
if ($product?->product_type !== 'hosting' || ! $product->servicePlan) {
continue;
}
if (! $this->hostingServers->hasHealthyServer($product->servicePlan)) {
throw new \InvalidArgumentException('Dịch vụ hosting đang bảo trì, vui lòng thử lại sau hoặc liên hệ quản trị viên.');
}
}
}
/**