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:
co-authored by
Claude Opus 5.5
parent
30898ea46f
commit
94614d9cb3
@@ -2,12 +2,15 @@
|
||||
|
||||
namespace Tests\Feature;
|
||||
|
||||
use App\Jobs\Mail\SendTemplateEmailJob;
|
||||
use App\Mail\ExpiryService;
|
||||
use App\Mail\GenericTemplateMail;
|
||||
use App\Models\Setting;
|
||||
use App\Services\Email\EmailTemplateService;
|
||||
use App\Support\AutoEmailGate;
|
||||
use Illuminate\Foundation\Testing\DatabaseTransactions;
|
||||
use Illuminate\Support\Facades\Mail;
|
||||
use Illuminate\Support\Facades\Queue;
|
||||
use Tests\TestCase;
|
||||
|
||||
class MailEnabledToggleTest extends TestCase
|
||||
@@ -72,4 +75,20 @@ class MailEnabledToggleTest extends TestCase
|
||||
{
|
||||
$this->assertSame('service_expiry', (new ExpiryService(0, []))->buildViewData()[AutoEmailGate::SCENARIO_DATA_KEY]);
|
||||
}
|
||||
|
||||
public function test_template_service_does_not_queue_when_mail_disabled_or_scenario_off(): void
|
||||
{
|
||||
Queue::fake();
|
||||
$service = app(EmailTemplateService::class);
|
||||
|
||||
$this->setMailEnabled(false);
|
||||
$service->send('order_created', 'user@example.com');
|
||||
|
||||
$this->disableAuto(['order_created']);
|
||||
$service->send('order_created', 'user@example.com');
|
||||
Queue::assertNothingPushed();
|
||||
|
||||
$service->send('domain_order_approved', 'user@example.com');
|
||||
Queue::assertPushed(SendTemplateEmailJob::class, 1);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user