<?php

namespace App\Models;

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

class ShippingRate extends Model
{
    protected $table = 'shipping_rates';

  protected $fillable = [
    'origin_city_id',
    'destination_village_id',
    'service_name',
    'service_type',
    'moda',               
    'price',
    'price_over_weight',  
    'min_weight',
    'max_weight', 
    'etd',
    'created_by',
    'updated_by',
];
    public function originCity(): BelongsTo
    {
        return $this->belongsTo(City::class, 'origin_city_id');
    }

public function destinationVillage(): BelongsTo
    {
        return $this->belongsTo(Village::class, 'destination_village_id');
    }
    public function creator(): BelongsTo
    {
        return $this->belongsTo(User::class, 'created_by');
    }

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