<?php

namespace App\Models;

use App\Enums\EarnLegalDocumentType;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;

class EarnLegalAcceptance extends Model
{
    protected $guarded = [];

    protected function casts(): array
    {
        return ['document_type' => EarnLegalDocumentType::class, 'accepted_at' => 'datetime'];
    }

    public function member(): BelongsTo
    {
        return $this->belongsTo(EarnMember::class, 'earn_member_id');
    }
}
