feat: khởi tạo/huỷ domain Plesk qua job, gửi mail hoá đơn qua queue, đính kèm triển khai

- ProvisionDnsDomainJob/SuspendDnsDomainJob: tạo domain admin lên Plesk, huỷ = suspend (is_created=3)
- Khách xem zone DNS được gán ở /dich-vu/domain, quản lý bản ghi A/AAAA/CNAME/TXT/MX/SRV
- send-mail hoá đơn đẩy SendInvoiceMailJob, preview + sửa nội dung, ghi mail.order_id
- invoice_attachments.type (payment_proof/deployment)
- CacheService xoá theo SCAN pattern, Redis không persistent mặc định
- Backfill transactions.public_code

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
baodev0
2026-10-11 09:56:18 +07:00
co-authored by Claude Opus 5.5
parent 30898ea46f
commit 94614d9cb3
55 changed files with 1190 additions and 236 deletions
@@ -16,6 +16,7 @@ trait ListsCustomerEmails
$paginator = Mail::query()
->with(['sender', 'template:id,name'])
->where('customer_id', $customer->id)
->when($request->filled('order_id'), fn ($q) => $q->where('order_id', (int) $request->get('order_id')))
->when($search !== '', fn ($q) => $q->where(fn ($q) => $q
->where('subject', 'like', "%{$search}%")
->orWhere('to', 'like', "%{$search}%")))
@@ -51,6 +51,27 @@ trait ManagesCustomerBilling
return response()->json(['error' => false, 'message' => 'Đã cập nhật giao dịch', 'data' => $transaction]);
}
public function createTransaction(string $uuid, Request $request): JsonResponse
{
$data = $request->validate([
'trans' => 'nullable|string|max:255',
'note' => 'nullable|string',
'amount' => 'required|integer|min:0',
'status' => 'nullable|integer|in:0,1,2',
]);
$transaction = $this->billingService->createTransaction($uuid, $data, $request->user()?->id);
return response()->json(['error' => false, 'message' => 'Đã thêm giao dịch', 'data' => $transaction], 201);
}
public function deleteTransaction(string $uuid, int $transactionId): JsonResponse
{
$this->billingService->deleteTransaction($uuid, $transactionId);
return response()->json(['error' => false, 'message' => 'Đã xoá giao dịch']);
}
public function getOrders(string $uuid): JsonResponse
{
return response()->json(['error' => false, 'data' => $this->billingService->getOrders($uuid)]);
@@ -66,6 +87,7 @@ trait ManagesCustomerBilling
'sub_total' => 'nullable|integer|min:0',
'discount_amount' => 'nullable|integer|min:0',
'total' => 'nullable|integer|min:0',
'note' => 'nullable|string|max:5000',
]);
$order = $this->billingService->updateOrder($uuid, $orderId, $data);