<?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('cupones', function (Blueprint $table) {
            $table->string('tipo', 20)->default('porcentaje')->after('codigo');
            $table->decimal('monto', 10, 2)->nullable()->after('porcentaje');
            $table->string('origen', 20)->default('manual')->after('activo');
        });
    }

    public function down(): void
    {
        Schema::table('cupones', function (Blueprint $table) {
            $table->dropColumn(['tipo', 'monto', 'origen']);
        });
    }
};
