<?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('customer_payment_collections', function (Blueprint $table) {
            $table->id();
            $table->unsignedBigInteger('customer_id')->nullable();
            $table->string('date');
            $table->string('supplier_id')->nullable();
            $table->string('payment')->nullable();
            $table->string('payment_id')->nullable();
            $table->string('payment_type')->nullable();
            $table->string('invoice_id')->nullable();
            $table->string('status')->nullable();
            $table->string('sales_person_id')->nullable();
            $table->string('order_no')->nullable();
            $table->string('notes')->nullable();
            $table->string('warehouse_id')->nullable();
            $table->string('collection_reference')->nullable();
            $table->unsignedBigInteger('transition_location_id')->nullable(); // or whatever default
            $table->unsignedBigInteger('transition_create_by')->nullable(); // user ID
            $table->unsignedBigInteger('transition_update_by')->nullable(); // user ID
            $table->timestamps();
        });
    }

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