<?php

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

return new class extends Migration
{
    /**
     * Run the migrations.
     */
    public function up(): void
    {
        Schema::table('payroll_summaries', function (Blueprint $table) {
            $table->decimal('payment_contributions_total', 15,3)->default(0)->after('loans_total');
            $table->decimal('total_additions', 15,3)->default(0)->after('other_deductions');
            $table->decimal('total_deductions', 15,3)->default(0)->after('total_additions');
        });
    }

    /**
     * Reverse the migrations.
     */
    public function down(): void
    {
        Schema::table('payroll_summaries', function (Blueprint $table) {
            $table->dropColumn('payroll_contributions_total');
            $table->dropColumn('total_additions');
            $table->dropColumn('total_deductions');
        });
    }
};
