<?php

namespace App\Models;

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

class WindedSerialValidationError extends Model
{
    use SoftDeletes;

    protected $fillable = [
        'plant_id',
        'item_id',
        'machine_id',
        'machine_name',
        'aufnr',
        'gernr',
        'model_type',
        'winded_status',
        'winded_qr',
        'winded_code',
        'winded_serial_number',
        'created_at',
        'updated_at',
        'created_by',
        'updated_by',
    ];

    public function plant(): BelongsTo
    {
        return $this->belongsTo(Plant::class);
    }

    public function item()
    {
        return $this->belongsTo(Item::class, 'item_id', 'id');
    }

    public function machine(): BelongsTo
    {
        return $this->belongsTo(Machine::class);
    }
}
