<?php

namespace App\Models\Tenant;

use App\Models\Concerns\BelongsToTenant;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;

class SupplierInvoiceMapping extends Model
{
    use BelongsToTenant;

    protected $fillable = [
        'company_id', 'supplier_id', 'mapping_config',
        'sample_file_name', 'last_used_at',
    ];

    protected $casts = [
        'mapping_config' => 'array',
        'last_used_at' => 'datetime',
    ];

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