<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;

class WorkRecord extends Model
{
    protected $fillable = [
        'equipment_id', 'operator_name', 'start_time', 'end_time', 
        'duration', 'duration_unit', 'base_cost', 'total_expenses', 
        'grand_total', 'status', 'site', 'payment_type', 'operator_salary', 'voucher_date'
    ];

    public function equipment()
    {
        return $this->belongsTo(Equipment::class);
    }

    public function expenses()
    {
        return $this->hasMany(Expense::class);
    }
}
