updates to UI and add archiving option
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class ArchiveEntity extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
|
||||
protected $fillable = [
|
||||
'focus',
|
||||
'related',
|
||||
'name',
|
||||
'description',
|
||||
'enabled',
|
||||
];
|
||||
|
||||
protected function casts(): array
|
||||
{
|
||||
return [
|
||||
'related' => 'array',
|
||||
'enabled' => 'boolean',
|
||||
];
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,43 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class ArchiveRun extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
|
||||
protected $fillable = [
|
||||
'archive_setting_id',
|
||||
'user_id',
|
||||
'status',
|
||||
'counts',
|
||||
'context',
|
||||
'started_at',
|
||||
'finished_at',
|
||||
'duration_ms',
|
||||
'message',
|
||||
];
|
||||
|
||||
protected function casts(): array
|
||||
{
|
||||
return [
|
||||
'counts' => 'array',
|
||||
'context' => 'array',
|
||||
'started_at' => 'datetime',
|
||||
'finished_at' => 'datetime',
|
||||
];
|
||||
}
|
||||
|
||||
public function setting()
|
||||
{
|
||||
return $this->belongsTo(ArchiveSetting::class, 'archive_setting_id');
|
||||
}
|
||||
|
||||
public function user()
|
||||
{
|
||||
return $this->belongsTo(User::class);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,66 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\SoftDeletes;
|
||||
|
||||
class ArchiveSetting extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
use SoftDeletes;
|
||||
|
||||
protected $fillable = [
|
||||
'action_id',
|
||||
'decision_id',
|
||||
'segment_id',
|
||||
'entities',
|
||||
'name',
|
||||
'description',
|
||||
'enabled',
|
||||
'strategy',
|
||||
'soft',
|
||||
'reactivate',
|
||||
'options',
|
||||
'created_by',
|
||||
'updated_by',
|
||||
];
|
||||
|
||||
protected function casts(): array
|
||||
{
|
||||
return [
|
||||
'entities' => 'array',
|
||||
'options' => 'array',
|
||||
'enabled' => 'boolean',
|
||||
'soft' => 'boolean',
|
||||
'reactivate' => 'boolean',
|
||||
];
|
||||
}
|
||||
|
||||
// Relationships (nullable FKs)
|
||||
public function action()
|
||||
{
|
||||
return $this->belongsTo(Action::class);
|
||||
}
|
||||
|
||||
public function decision()
|
||||
{
|
||||
return $this->belongsTo(Decision::class);
|
||||
}
|
||||
|
||||
public function segment()
|
||||
{
|
||||
return $this->belongsTo(Segment::class);
|
||||
}
|
||||
|
||||
public function creator()
|
||||
{
|
||||
return $this->belongsTo(User::class, 'created_by');
|
||||
}
|
||||
|
||||
public function updater()
|
||||
{
|
||||
return $this->belongsTo(User::class, 'updated_by');
|
||||
}
|
||||
}
|
||||
@@ -56,6 +56,7 @@ public function segments(): BelongsToMany
|
||||
public function account(): HasOne
|
||||
{
|
||||
return $this->hasOne(\App\Models\Account::class)
|
||||
->latestOfMany()
|
||||
->with('type');
|
||||
}
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@ class Import extends Model
|
||||
use HasFactory;
|
||||
|
||||
protected $fillable = [
|
||||
'uuid','user_id','import_template_id','client_id','source_type','file_name','original_name','disk','path','size','sheet_name','status','total_rows','valid_rows','invalid_rows','imported_rows','started_at','finished_at','failed_at','error_summary','meta'
|
||||
'uuid', 'user_id', 'import_template_id', 'client_id', 'source_type', 'file_name', 'original_name', 'disk', 'path', 'size', 'sheet_name', 'status', 'reactivate', 'total_rows', 'valid_rows', 'invalid_rows', 'imported_rows', 'started_at', 'finished_at', 'failed_at', 'error_summary', 'meta',
|
||||
];
|
||||
|
||||
protected $casts = [
|
||||
@@ -21,6 +21,7 @@ class Import extends Model
|
||||
'started_at' => 'datetime',
|
||||
'finished_at' => 'datetime',
|
||||
'failed_at' => 'datetime',
|
||||
'reactivate' => 'boolean',
|
||||
];
|
||||
|
||||
public function user(): BelongsTo
|
||||
|
||||
@@ -12,13 +12,14 @@ class ImportTemplate extends Model
|
||||
use HasFactory;
|
||||
|
||||
protected $fillable = [
|
||||
'uuid', 'name', 'description', 'source_type', 'default_record_type', 'sample_headers', 'user_id', 'client_id', 'is_active', 'meta'
|
||||
'uuid', 'name', 'description', 'source_type', 'default_record_type', 'sample_headers', 'user_id', 'client_id', 'is_active', 'reactivate', 'meta',
|
||||
];
|
||||
|
||||
protected $casts = [
|
||||
'sample_headers' => 'array',
|
||||
'meta' => 'array',
|
||||
'is_active' => 'boolean',
|
||||
'reactivate' => 'boolean',
|
||||
];
|
||||
|
||||
public function user(): BelongsTo
|
||||
|
||||
Reference in New Issue
Block a user