<?php

namespace App\Modules\Pilkades\Models;

use App\Core\Concerns\HasUuid;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;

class CandidateProfile extends Model
{
    use HasUuid;

    protected $table = 'candidate_profiles';

    protected $fillable = [
        'candidate_id',
        'tempat_lahir',
        'tanggal_lahir',
        'pendidikan_terakhir',
        'alamat',
        'riwayat_pekerjaan',
        'visi',
        'misi',
    ];

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

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