<?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::create('accounts', function (Blueprint $table) {
            $table->id();
            $table->string('name');
            $table->enum('currency', ['USD', 'BOB'])->default('USD');
            $table->enum('fee_type', ['none', 'takenos'])->default('none');
            $table->decimal('fee_percent', 5, 2)->default(0);
            $table->decimal('fee_fixed', 10, 2)->default(0);
            $table->timestamps();

            $table->index('currency');
            $table->index('fee_type');
        });
    }

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