<?php

namespace Modules\Inventory\Models;

use Illuminate\Database\Eloquent\Model;
use Modules\Accounts\Models\Traits\HasVatTransactions;
use Modules\Inventory\Models\Traits\HasAmcContracts;
use Modules\Inventory\Models\Traits\HasInventoryDepartment;
use Modules\Inventory\Models\Traits\HasProduct;

class Asset extends Model
{
    use HasProduct,
        HasInventoryDepartment,
        HasAmcContracts,
        HasVatTransactions;

    /**
     * The attributes that are mass assignable.
     */
    protected $fillable = [
        'product_id',
        'purchase_invoice_id',
        'purchase_invoice_item_id',
        'asset_code',
        'serial_no',
        'inventory_department_id',
        'purchase_date',
        'warranty_expiry',
        'purchase_cost',
        'status',
    ];

    public function movements()
    {
        return $this->hasMany(AssetMovement::class);
    }
}
