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
@@ -0,0 +1,30 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Str;
return new class extends Migration
{
public function up(): void
{
DB::table('transactions')
->whereNull('public_code')
->orderBy('id')
->select(['id', 'type', 'created_at'])
->chunkById(500, function ($transactions) {
foreach ($transactions as $transaction) {
$prefix = $transaction->type === 'transfer' || $transaction->type === 'balance' ? 'SVC' : 'TXN';
$date = $transaction->created_at ? date('Ymd', strtotime($transaction->created_at)) : now()->format('Ymd');
DB::table('transactions')
->where('id', $transaction->id)
->update(['public_code' => $prefix . '-' . $date . '-' . strtoupper(Str::random(6))]);
}
});
}
public function down(): void
{
}
};
@@ -0,0 +1,22 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
public function up(): void
{
Schema::table('invoice_attachments', function (Blueprint $table) {
$table->string('type', 30)->default('payment_proof')->after('invoice_id')->index();
});
}
public function down(): void
{
Schema::table('invoice_attachments', function (Blueprint $table) {
$table->dropColumn('type');
});
}
};
@@ -0,0 +1,23 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
public function up(): void
{
Schema::table('mail', function (Blueprint $table) {
$table->unsignedBigInteger('order_id')->nullable()->index()->after('customer_id');
});
}
public function down(): void
{
Schema::table('mail', function (Blueprint $table) {
$table->dropIndex(['order_id']);
$table->dropColumn('order_id');
});
}
};