<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;

class CityHRACLA extends Model
{
    use SoftDeletes;

    protected $table = 'city_hracla';
    protected $primaryKey = 'CHC_Id';
    public $incrementing = true;
    protected $keyType = 'int';

    public $timestamps = true;

    const CREATED_AT = 'created_at';
    const UPDATED_AT = 'updated_at';
    const DELETED_AT = 'deleted_at';

    protected $fillable = [
        'CGR_Id',
        'HRA_1',
        'CLA_1',
        'Basic_From',
        'Basic_To',
        'HRA_Min',
        'HRA_UT24',
        'HRA_UT49',
        'HRA_AB49',
        'HRA_6th',
        'HRA_7th'
    ];

    protected $casts = [
        'CHC_Id' => 'integer',
        'CGR_Id' => 'integer',
        'HRA_1' => 'integer',
        'CLA_1' => 'integer',
        'Basic_From' => 'integer',
        'Basic_To' => 'integer',
        'HRA_Min' => 'integer',
        'HRA_UT24' => 'integer',
        'HRA_UT49' => 'integer',
        'HRA_AB49' => 'integer',
        'HRA_6th' => 'integer',
        'HRA_7th' => 'integer',
        'created_at' => 'datetime',
        'updated_at' => 'datetime',
        'deleted_at' => 'datetime'
    ];

    protected $hidden = [
        'deleted_at'
    ];

    public function cityGrade()
    {
        return $this->belongsTo(CityGrade::class, 'CGR_Id', 'CGR_Id');
    }
}
