<?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('clients', function (Blueprint $table) {
            $table->bigIncrements('id');

            // Basic Data
            $table->string('client_name', 200);
            $table->string('client_phone', 25)->nullable();
            $table->string('client_email', 200)->nullable();
            $table->string('client_state', 100)->nullable();

            // Identity Document Data
            $table->enum('identity_document_type', [
                'none',                 // Ninguno
                'voter_id',             // Clave de Elector
                'passport',             // Pasaporte
                'drivers_license',      // Licencia de Manejo
                'national_id_number',   // Identificador Nacional (CURP, SSN...)
                'license_plate',        // Placa Vehicular
            ])->default('none');
            $table->string('identity_document_number')->default("--- --- ---");

            // Behavior Control
            $table->string('customer_segment')->default('occasional');
            $table->string('behavior_report')->default('none');

            // Loyalty Data
            $table->decimal('discount_per_loyalty',10,2)->default(0.0);

            $table->timestamps();
        });
    }

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