<?php

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

return new class extends Migration
{
    public function up(): void
    {
        Schema::table('transactions', function (Blueprint $table) {
            $table->boolean('use_cashback')->default(false)->after('discount_amount');
            $table->decimal('wallet_debit_amount', 14, 2)->default(0)->after('use_cashback');
            $table->decimal('cashback_debit_amount', 14, 2)->default(0)->after('wallet_debit_amount');
        });
    }

    public function down(): void
    {
        Schema::table('transactions', function (Blueprint $table) {
            $table->dropColumn(['use_cashback', 'wallet_debit_amount', 'cashback_debit_amount']);
        });
    }
};

