55 lines
1.1 KiB
PHP
55 lines
1.1 KiB
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
|
use Illuminate\Database\Eloquent\Model;
|
|
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
|
|
|
class BulkOperationRun extends Model
|
|
{
|
|
use HasFactory;
|
|
|
|
protected $fillable = [
|
|
'tenant_id',
|
|
'user_id',
|
|
'resource',
|
|
'action',
|
|
'idempotency_key',
|
|
'status',
|
|
'total_items',
|
|
'processed_items',
|
|
'succeeded',
|
|
'failed',
|
|
'skipped',
|
|
'item_ids',
|
|
'failures',
|
|
'audit_log_id',
|
|
];
|
|
|
|
protected $casts = [
|
|
'item_ids' => 'array',
|
|
'failures' => 'array',
|
|
'processed_items' => 'integer',
|
|
'total_items' => 'integer',
|
|
'succeeded' => 'integer',
|
|
'failed' => 'integer',
|
|
'skipped' => 'integer',
|
|
];
|
|
|
|
public function tenant(): BelongsTo
|
|
{
|
|
return $this->belongsTo(Tenant::class);
|
|
}
|
|
|
|
public function user(): BelongsTo
|
|
{
|
|
return $this->belongsTo(User::class);
|
|
}
|
|
|
|
public function auditLog(): BelongsTo
|
|
{
|
|
return $this->belongsTo(AuditLog::class);
|
|
}
|
|
}
|