<?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('sales_return_masters', function (Blueprint $table) {
            $table->id();
            $table->string('reference_no');
            $table->string('return_date');
            $table->string('customer_id')->nullable();
            $table->string('supplier_id')->nullable();
            $table->string('sales_invoice_no')->nullable();
            $table->string('total');
            $table->string('shop_id')->nullable();
            $table->integer('status')->nullable();
            $table->string('create_by')->nullable();
            $table->string('policy')->nullable();
            $table->unsignedBigInteger('location_id')->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
            $table->timestamps();
        });
    }

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