<?php

namespace App\Models;

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

class TrialCompanyDealer extends Model
{
    use HasFactory;

    protected $fillable = [
        'trial_company_id',
        'master_dealer_id',
        'sub_dealer_id',
    ];

    public function trialCompany(): BelongsTo
    {
        return $this->belongsTo(TrialCompanyProfile::class, 'trial_company_id', 'company_id');
    }

    public function masterDealer(): BelongsTo
    {
        return $this->belongsTo(MasterDealer::class, 'master_dealer_id');
    }

    public function subDealer(): BelongsTo
    {
        return $this->belongsTo(SubDealer::class, 'sub_dealer_id');
    }
}
