This commit is contained in:
baodev0
2026-07-01 10:51:05 +07:00
parent 914e96138a
commit 3bb59feba3
43 changed files with 1680 additions and 28 deletions
@@ -0,0 +1,61 @@
<?php
namespace Modules\DomainFluctuation\App\Models;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
class DomainFluctuation extends Model
{
use HasFactory;
protected $table = 'domain_fluctuations';
protected $fillable = [
'domainName',
'term_id',
'registeredDate',
'expiredDate',
'ownerName',
'ownerType',
'address',
'wardName',
'districtName',
'cityName',
'cityCode',
'countryCode',
'phone',
'email',
'fax',
'adminName',
'businessCode',
'eidCode',
'personalId',
'birthDate',
'icannRegistrarName',
'icannRegistrarTradeName',
'isAgentManager',
'action',
'actionReason',
'actionSource',
'actionDate',
'note',
'ianaNumber',
'status',
];
protected $casts = [
'isAgentManager' => 'boolean',
'status' => 'integer',
'registeredDate' => 'integer',
'expiredDate' => 'integer',
'actionDate' => 'integer',
'ianaNumber' => 'integer',
];
public function term(): BelongsTo
{
return $this->belongsTo(DomainFluctuationTerm::class, 'term_id');
}
}
@@ -0,0 +1,15 @@
<?php
namespace Modules\DomainFluctuation\App\Models;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
class DomainFluctuationName extends Model
{
use HasFactory;
protected $table = 'domain_fluctuation_names';
protected $fillable = ['domain_name'];
}
@@ -0,0 +1,38 @@
<?php
namespace Modules\DomainFluctuation\App\Models;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\HasMany;
use Illuminate\Database\Eloquent\Relations\HasOne;
class DomainFluctuationTerm extends Model
{
use HasFactory;
protected $table = 'domain_fluctuation_terms';
protected $fillable = [
'user_id',
'term_name',
'description',
'date_create',
'status',
];
protected $casts = [
'status' => 'boolean',
'date_create' => 'integer',
];
public function fluctuations(): HasMany
{
return $this->hasMany(DomainFluctuation::class, 'term_id');
}
public function type(): HasOne
{
return $this->hasOne(TermFluctuationType::class, 'term_fluctuation_id');
}
}
@@ -0,0 +1,29 @@
<?php
namespace Modules\DomainFluctuation\App\Models;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
class TermFluctuationType extends Model
{
use HasFactory;
protected $table = 'term_fluctuation_type';
protected $fillable = [
'term_fluctuation_id',
'type',
];
public function term(): BelongsTo
{
return $this->belongsTo(DomainFluctuationTerm::class, 'term_fluctuation_id');
}
public function getTypeLabelAttribute(): string
{
return $this->type === 'vnnic_06' ? 'VNNIC 06' : 'VNNIC 07';
}
}