<?php

namespace App\Models;

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

class WithdrawalWaiver extends Model
{
    use HasUuids;

    protected $fillable = [
        'user_id',
        'plan_id',
        'plan_name',
        'billing',
        'amount_cents',
        'checkout_type',
        'right_acknowledged',
        'waiver_confirmed',
        'confirmed_at',
        'ip_address',
        'user_agent',
        'pdf_path',
    ];

    protected $casts = [
        'right_acknowledged' => 'boolean',
        'waiver_confirmed'   => 'boolean',
        'confirmed_at'       => 'datetime',
    ];

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

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