<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\HasMany;

class Equipment extends Model
{
    protected $fillable = [
        'name',
        'serial_number',
        'purchase_date',
        'last_maintenance',
        'next_maintenance',
        'condition',
        'notes'
    ];

    protected $casts = [
        'purchase_date' => 'date',
        'last_maintenance' => 'date',
        'next_maintenance' => 'date',
    ];

    public function maintenanceLogs(): HasMany
    {
        return $this->hasMany(\App\Models\MaintenanceLog::class);
    }
}