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

            $table->dateTime('order_date');                                         // Fecha de registro
            $table->string('order_table');                                      // Mesa Atendida
            $table->string('order_cashier');                                    // Cajero que atendió
            $table->string('order_payment_method');                             // Método de Pago utilizado

            $table->decimal('order_total',10,2)->default(0.0);                  // Total a pagar
            $table->decimal('order_discount_percentage',10,2)->default(0.0);    // % de Descuento aplicado
            $table->decimal('order_discount',10,2);                             // Cantidad descontada

            $table->decimal('order_payment',10,2);                              // Pago recibido
            $table->decimal('order_change',10,2);                               // Cambio monetario

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

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