<?php

namespace App\Modules\LoanOrder\Models;

use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\HasMany;
use Spatie\Translatable\HasTranslations;

/**
 * @property int $id
 * @property string $name
 * @property string $value
 * @property \Illuminate\Support\Carbon $created_at
 * @property \Illuminate\Support\Carbon $updated_at
 */
class LoanOrderRequiredDocs extends Model
{
    use HasTranslations;

    /**
     * Table
     */
    protected $table = 'loan_order_required_docs';

    /**
     * Translatable fields
     *
     * @var array<int, string>
     */
    public $translatable = [
        'name',
        'value',
    ];

    /**
     * Loan orders
     *
     * @return HasMany<LoanOrder, $this>
     */
    public function loanOrders(): HasMany
    {
        return $this->hasMany(LoanOrder::class, 'loan_order_required_doc_id');
    }
}
