<?php

namespace App\Models\INSURANCE;

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

class CommissionDefault extends Model
{
    use HasFactory;

    // Allow mass assignment on these fields.
    protected $fillable = [
        'insurer_id',
        'insurance_type_id',
        'commission_rate',
    ];

    /**
     * Relationship: CommissionDefault belongs to an Insurer.
     */
    public function insurer()
    {
        return $this->belongsTo(Insurer::class, 'insurer_id');
    }

    /**
     * Relationship: CommissionDefault belongs to an InsuranceType.
     */
    public function insuranceType()
    {
        return $this->belongsTo(InsuranceType::class, 'insurance_type_id');
    }
}
