<?php

namespace App\Models\Inventory;

use App\Models\Concerns\Auditable;
use App\Models\Concerns\BelongsToTenant;
use App\Models\Purchasing\Supplier;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
use Illuminate\Database\Eloquent\Relations\HasMany;
use Illuminate\Database\Eloquent\SoftDeletes;

class SupplierDocument extends Model
{
    use Auditable, BelongsToTenant, SoftDeletes;

    protected $fillable = [
        'supplier_id', 'document_number', 'reference', 'document_name', 'file_path',
    ];

    public function grns(): HasMany
    {
        return $this->hasMany(Grn::class);
    }

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