<?php

namespace App\Models;

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

class PumpTestingEntry extends Model
{
    use SoftDeletes;

    protected $fillable = [
        'plant_id',
        'pump_testing_master_id',
        'tested_date',
        'tested_type',
        'pump_serial_number',
        'correction_head',
        'sl_no',
        'voltage',
        'frequency',
        'speed',
        'head',
        'flow_reading',
        'current',
        'watt',
        'created_at',
        'created_by',
        'updated_at',
        'updated_by',
    ];

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

    public function pumpTestingMasters(): BelongsTo
    {
        return $this->belongsTo(PumpTestingMaster::class, 'pump_testing_master_id', 'id');
    }
}
