update email template

This commit is contained in:
baodev0
2026-09-09 16:56:22 +07:00
parent d3d9f76ba0
commit 2365ef72e9
210 changed files with 6335 additions and 4688 deletions
@@ -0,0 +1,46 @@
<?php
namespace App\Integrations\Whmcs\Writers;
use App\Integrations\Whmcs\DTOs\CustomerDomainData;
use App\Integrations\Whmcs\Support\DnsDomainLinker;
use Illuminate\Support\Facades\DB;
class CustomerDomainWriter
{
public function __construct(private DnsDomainLinker $dnsLinker)
{
}
/**
* Skips domains whose WHMCS client couldn't be resolved to a local customer.
*/
public function write(CustomerDomainData $data): bool
{
if ($data->customerId === null) {
return false;
}
DB::table('module_domain')->updateOrInsert(
['legacy_id' => $data->legacyId],
[
'name' => $data->name,
'order_id' => $data->orderId,
'first_payment' => $data->firstPayment,
'module_dns_id' => 0,
'next_payment' => $data->nextPayment,
'next_due_date' => $data->nextDueDate,
'next_invoice_date' => $data->nextInvoiceDate,
'customer_id' => $data->customerId,
'domain_type_id' => 0,
'registrar_id' => $data->registrarId,
'note' => $data->note,
'status' => $data->status,
]
);
$this->dnsLinker->link($data->name, $data->customerId, $data->registrarId);
return true;
}
}