<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;

class FoodDistribution extends Model
{
    protected $fillable = [
        'dealer_id', 
        'client_id', 
        'nid_number', 
        'word_number', 
        'distributed_at',
        'distributor_id'
    ];

    public function client(): BelongsTo
    {
        return $this->belongsTo(OmsClient::class, 'client_id');
    }

    public function dealer(): BelongsTo
    {
        return $this->belongsTo(OmsDealer::class, 'dealer_id');
    }

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