<?php

namespace App\Modules\HR\Assets\Models;

use App\Models\User;
use App\Modules\HR\Employees\Models\Employee;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;

class AssetMovement extends Model
{
    public const UPDATED_AT = null;

    protected $table = 'hr_asset_movements';

    protected $fillable = ['asset_id', 'employee_id', 'action', 'notes', 'created_by'];

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

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

    public function createdBy(): BelongsTo
    {
        return $this->belongsTo(User::class, 'created_by');
    }
}
