<?php

namespace App\Models;

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

class VoterArea extends Model
{
    protected $fillable = [
        'seat_id',
        'ward_id',
        'district_id',
        'upazila_id',
        'city_id',
        'area_name_bn',
        'area_name_en',
        'area_code',
        'postal_code',
        'post_office_bn',
        'post_office_en',
        'total_voters',
        'male_voters',
        'female_voters',
        'other_voters',
        'status',
    ];

    protected $casts = [
        'total_voters' => 'integer',
        'male_voters' => 'integer',
        'female_voters' => 'integer',
        'other_voters' => 'integer',
    ];

    public function seat(): BelongsTo
    {
        return $this->belongsTo(Seat::class);
    }

    public function ward(): BelongsTo
    {
        return $this->belongsTo(Ward::class);
    }

    public function district(): BelongsTo
    {
        return $this->belongsTo(District::class);
    }

    public function upazila(): BelongsTo
    {
        return $this->belongsTo(Upazila::class);
    }

    public function city(): BelongsTo
    {
        return $this->belongsTo(City::class);
    }
}
