<?php

namespace App\Models;

class Forwarder extends AbstractModel
{
    protected $table = 'forwarder';

    protected $fillable = [
        'name', 'email', 'shipping_rate', 'markup_percentage','minimum_cbm'
    ];

    public function addressBook()
    {
        return $this->hasMany('App\Models\AddressBook', 'reference_id', 'id')->where('type', '=', 0);
    }

    public function customerRelation()
    {
        return $this->hasMany(CustomerRelation::class, 'forwarder_id');
    }

    public function locationFees()
    {
        return $this->hasMany(LocationFees::class, 'forwarder_id');
    }

    public function serviceFees()
    {
        return $this->hasMany(ServiceFees::class, 'forwarder_id');
    }

}
