<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

return new class extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('dps_installments', function (Blueprint $table) {
            $table->id();
            $table->foreignId('dps_account_id');
            $table->date('installment_date');
            $table->decimal('amount', 12, 2);
            $table->boolean('is_paid')->default(false);
            $table->date('paid_at')->nullable();
             $table->decimal('remaining_amount', 14, 2)->default(0);
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('dps_installments');
    }
};
