<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;

class ImportBatch extends Model
{
    use SoftDeletes;

    protected $fillable = [
        'batch_number',
        'file_name',
        'file_type',
        'file_path',
        'completed',
    ];

    protected $casts = [
        'completed' => 'integer',
    ];

    public function rows()
    {
        return $this->hasMany(ImportBatchRow::class, 'import_batch_id');
    }
}

