<?php

namespace App\Models;

use App\Models\Concerns\HasPublicId;
use Illuminate\Database\Eloquent\Model;

final class RateCard extends Model
{
    use HasPublicId;

    protected $table = 'rate_cards';

    protected $fillable = [
        'public_id',
        'company_id',
        'contract_id',
        'party_id',
        'rate_side',
        'service_type_id',
        'route_id',
        'vehicle_type',
        'charge_basis',
        'rate',
        'minimum_charge',
        'waiting_rate',
        'free_waiting_minutes',
        'fuel_surcharge_percentage',
        'additional_stop_rate',
        'effective_from',
        'effective_to',
        'is_active',
    ];

    protected function casts(): array
    {
        return ['rate'=>'decimal:4', 'minimum_charge'=>'decimal:4', 'waiting_rate'=>'decimal:4', 'free_waiting_minutes'=>'decimal:2', 'fuel_surcharge_percentage'=>'decimal:4', 'additional_stop_rate'=>'decimal:4', 'effective_from'=>'date', 'effective_to'=>'date', 'is_active'=>'boolean'];
    }
}
