<?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('kjpp', function (Blueprint $table) {
            $table->id();
            $table->string('code');
            $table->string('name');
            $table->string('jenis_kantor');
            $table->string('nomor_ijin_usaha');
            $table->string('province_code');
            $table->string('city_code')->nullable();
            $table->string('district_code')->nullable();
            $table->string('village_code')->nullable();
            $table->string('address');
            $table->string('postal_code')->nullable();
            $table->string('nomor_telepon_kantor')->nullable();
            $table->string('email_kantor');
            $table->string('detail_email_kantor')->nullable();
            $table->string('nama_pimpinan');
            $table->string('nomor_hp_pimpinan');
            $table->string('nama_pic_reviewer')->nullable();
            $table->string('detail_nama_pic_reviewer')->nullable();
            $table->string('nomor_hp_pic_reviewer')->nullable();
            $table->string('detail_nomor_hp_pic_reviewer')->nullable();
            $table->string('nama_pic_admin')->nullable();
            $table->string('detail_nama_pic_admin')->nullable();
            $table->string('nomor_hp_pic_admin')->nullable();
            $table->string('detail_nomor_hp_pic_admin')->nullable();
            $table->string('nama_pic_marketing')->nullable();
            $table->string('detail_nama_pic_marketing')->nullable();
            $table->string('nomor_hp_pic_marketing')->nullable();
            $table->string('detail_nomor_hp_pic_marketing')->nullable();
            $table->string('ijin_usaha_id');
            $table->string('jenis_aset_id');
            $table->string('attachment')->nullable();
            $table->boolean('status')->default(true)->nullable();
            $table->char('authorized_status', 1)->nullable();
            $table->timestamp('authorized_at')->nullable();
            $table->unsignedBigInteger('authorized_by')->nullable();
            $table->softDeletes();

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

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