- Nạp tiền: mã thanh toán sống 30 phút (ManualDepositDraft), khôi phục/huỷ mã, lệnh dọn mã hết hạn; total_pending chỉ tính giao dịch đã nộp chứng từ, admin duyệt/từ chối/xoá giao dịch - Gia hạn dịch vụ: phát hành invoice gia hạn trên order gốc và trừ số dư ngay - Đồng bộ domain từ Plesk theo server, ServiceOrderRecorder tạo order/invoice cho dịch vụ admin dựng - Danh sách dịch vụ trả field theo loại (service_plan, dns_records_count), đếm dịch vụ theo loại Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
43 lines
1.2 KiB
PHP
43 lines
1.2 KiB
PHP
<?php
|
|
|
|
namespace App\Events;
|
|
|
|
use Illuminate\Broadcasting\Channel;
|
|
use Illuminate\Broadcasting\InteractsWithSockets;
|
|
use Illuminate\Contracts\Broadcasting\ShouldBroadcastNow;
|
|
use Illuminate\Foundation\Events\Dispatchable;
|
|
use Illuminate\Queue\SerializesModels;
|
|
|
|
class DnsSyncCompleted implements ShouldBroadcastNow
|
|
{
|
|
use Dispatchable, InteractsWithSockets, SerializesModels;
|
|
|
|
public function __construct(
|
|
public readonly int $synced,
|
|
public readonly array $failedDomains,
|
|
public readonly int $imported = 0,
|
|
) {}
|
|
|
|
public function broadcastOn(): array
|
|
{
|
|
return [new Channel('admin-notifications')];
|
|
}
|
|
|
|
public function broadcastAs(): string
|
|
{
|
|
return 'dns.sync.completed';
|
|
}
|
|
|
|
public function broadcastWith(): array
|
|
{
|
|
return [
|
|
'synced' => $this->synced,
|
|
'failed_domains' => $this->failedDomains,
|
|
'imported' => $this->imported,
|
|
'message' => $this->imported > 0
|
|
? "Đã nhập {$this->imported} tên miền và đồng bộ {$this->synced} bản ghi DNS từ Plesk"
|
|
: "Đã đồng bộ {$this->synced} bản ghi DNS từ Plesk",
|
|
];
|
|
}
|
|
}
|