<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;

class ImmigoProInstallmentPayment extends Model
{
    protected $table = 'immigopro_installment_payments';

    protected $fillable = [
        'subscription_id',
        'installment_number',
        'amount',
        'stripe_payment_intent_id',
        'status',
        'paid_at',
    ];

    protected $casts = [
        'amount' => 'decimal:2',
        'paid_at' => 'datetime',
    ];

    /**
     * Get the subscription that this payment belongs to
     */
    public function subscription()
    {
        return $this->belongsTo(ImmigoProSubscription::class, 'subscription_id');
    }
}
