<?php

namespace App\Models;

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

class ElectionEvent extends Model
{
    protected $fillable = ['name', 'election_date', 'status', 'notes'];

    protected function casts(): array
    {
        return [
            'election_date' => 'date',
        ];
    }

    public function voteTallies(): HasMany
    {
        return $this->hasMany(VoteTally::class);
    }
}
