<?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('persetujuan_penawaran', function (Blueprint $table) {
            $table->id();
            $table->foreignId('penawaran_id')->constrained('penawaran');
            $table->string('nomor_proposal_penawaran');
            $table->date('tanggal_proposal_penawaran');
            $table->string('biaya_final');
            $table->datetime('sls_resume');
            $table->datetime('sla_final');
            $table->string('catatan');
            $table->string('attachment');
            $table->foreignId('region_id')->constrained('regions');
            $table->boolean('status')->default(true)->nullable();
            $table->char('authorized_status', 1)->nullable();
            $table->timestamp('authorized_at')->nullable();
            $table->unsignedBigInteger('authorized_by')->nullable();
            $table->timestamps();
            $table->softDeletes();

            $table->unsignedBigInteger('deleted_by')->nullable();
        });
    }

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