<?php

namespace App\Models;

use App\Filters\MoveOrderFilters;
use Essa\APIToolKit\Filters\Filterable;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;

class MoveOrder extends Model
{
    use HasFactory, SoftDeletes, Filterable;

    protected string $default_filters = MoveOrderFilters::class;

    protected $table = "move_orders";

    protected $fillable = [
        'document_no',
        'farm_id',
        // 'building_id',
        'order_date',
        'status',
        'remarks',
        'description',
        'caretaker_id',
        'user_id',
    ];

    public function moveItems()
    {
        return $this->hasMany(MoveOrderItem::class, 'move_order_id', 'id');
    }
}
