<?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('borang_ulasan_iks', function (Blueprint $table) {
            $table->id();
            $table->integer('lesen_penjaja_id');
            $table->integer('pegawai_id')->nullable();
            $table->dateTime('dt_rujuk_ppkp')->nullable();
            $table->date('dt_periksa')->nullable();
            $table->enum('kesesuaian_lokasi', ['sesuai', 'tidak sesuai'])->nullable();
            $table->text('kesesuaian_lokasi_sebab')->nullable();
            $table->enum('dijalankan_oleh', ['pemohon/pelesen', 'orang lain'])->nullable();
            $table->enum('pematuhan_syarat', ['telah dipatuhi', 'belum dipatuhi'])->nullable();
            $table->text('perkara_perlu_dipatuhi')->nullable();
            $table->enum('pemprosesan_makanan', ['ada', 'tiada'])->nullable();
            $table->enum('pemprosesan_makanan_memasak', ['0', '1'])->nullable();
            $table->enum('pemprosesan_makanan_merebus', ['0', '1'])->nullable();
            $table->enum('pemprosesan_makanan_menggoreng', ['0', '1'])->nullable();
            $table->string('pemprosesan_makanan_lain')->nullable();
            $table->text('pemprosesan_makanan_lain_txt')->nullable();
            $table->enum('mendirikan_bangunan', ['ada', 'tiada'])->nullable();
            $table->enum('jika_guna_kenderaan', ['motosikal','kereta/van','lori','basikal','lain-lain'])->nullable();
            $table->string('jenis_kenderaan_lain')->nullable();
            $table->string('no_plate_kenderaan')->nullable();
            $table->date('dt_mula_niaga')->nullable();
            $table->string('masa_berniaga_mula')->nullable();
            $table->enum('kebersihan_diri', ['memuaskan', 'tidak'])->nullable();
            $table->enum('kebersihan_makanan', ['memuaskan', 'tidak'])->nullable();
            $table->enum('kebersihan_kawasan', ['memuaskan', 'tidak'])->nullable();
            $table->text('laporan_kebersihan_selepas_niaga')->nullable();
            $table->enum('cadangan', ['tiada halangan','tidak menyokong','permohonan / lesen dibatalkan kerana tamat perniagaan'])->nullable();
            $table->text('tiada_halangan_syarat')->nullable();
            $table->enum('tiada_halangan_notis_dipatuhi', ['0', '1'])->nullable();
            $table->text('tidak_menyokong_atas_sebab')->nullable();
            $table->enum('dirujuk_unit_penguatkuasa', ['0', '1'])->nullable();
            $table->text('dirujuk_unit_penguatkuasa_txt')->nullable();
            $table->timestamps();
        });
    }

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