<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;

class CustomerQualitySyncLog extends Model
{
    protected $guarded = ['id'];

    protected $casts = [
        'eligible_count' => 'integer',
        'add_count' => 'integer',
        'remove_count' => 'integer',
        'skipped_count' => 'integer',
        'skipped_reasons' => 'array',
        'skipped_rows' => 'array',
        'meta_http_status' => 'integer',
        'meta_response' => 'array',
        'expires_at' => 'datetime',
        'started_at' => 'datetime',
        'finished_at' => 'datetime',
        'created_at' => 'datetime',
        'updated_at' => 'datetime',
    ];

    public function syncedByAdmin()
    {
        return $this->belongsTo(Admin::class, 'synced_by_admin_id');
    }
}
