<?php

namespace Modules\MembershipApplication\Entities;

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

class MembershipApplicationHeir extends Model
{
    use HasUuids;

    protected $table = 'membership_application_heirs';

    /**
     * @var list<string>
     */
    protected $fillable = [
        'membership_application_id',
        'name',
        'ic_number',
        'relationship',
        'phone_number',
    ];

    /**
     * @var list<string>
     */
    protected $hidden = [
    ];

    protected function casts(): array
    {
        return [
            'name' => 'string',
            'ic_number' => 'string',
            'relationship' => 'string',
            'phone_number' => 'string',
        ];
    }

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