- 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>
63 lines
1.4 KiB
PHP
63 lines
1.4 KiB
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use App\Traits\LogsActivity;
|
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
|
use Illuminate\Database\Eloquent\Model;
|
|
|
|
class DnsDomain extends Model
|
|
{
|
|
use HasFactory, LogsActivity;
|
|
|
|
public const STATUS_PENDING = 0;
|
|
public const STATUS_CREATED = 1;
|
|
public const STATUS_INACTIVE = 2;
|
|
public const STATUS_CANCELLED = 3;
|
|
|
|
protected $table = 'dns_manager_domain';
|
|
|
|
protected $fillable = [
|
|
'domain_name',
|
|
'dns_manager_server_id',
|
|
'is_created',
|
|
'plesk_id',
|
|
'registrar_id',
|
|
];
|
|
|
|
public function scopeNotCancelled($query)
|
|
{
|
|
return $query->where('is_created', '!=', self::STATUS_CANCELLED);
|
|
}
|
|
|
|
public function customer()
|
|
{
|
|
return $this->belongsToMany(Customer::class, 'dns_domain_user', 'domain_id', 'user_id')->withTimestamps();
|
|
}
|
|
|
|
public function registrar()
|
|
{
|
|
return $this->belongsTo(Registrar::class);
|
|
}
|
|
|
|
public function users()
|
|
{
|
|
return $this->customer();
|
|
}
|
|
|
|
public function server()
|
|
{
|
|
return $this->belongsTo(DnsServer::class, 'dns_manager_server_id', 'id');
|
|
}
|
|
|
|
public function ns()
|
|
{
|
|
return $this->hasMany(DnsManagerNS::class, 'dns_manager_domain_id', 'id');
|
|
}
|
|
|
|
public function record()
|
|
{
|
|
return $this->hasMany(DnsRecord::class, 'dns_manager_domain_id', 'id');
|
|
}
|
|
}
|