<?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::table('lesen_penjajas', function (Blueprint $table) {
            $table->string('no_akaun_lesen')->nullable();
            $table->string('no_fail_lesen')->nullable();
            $table->string('kod_lesen')->nullable();
            $table->string('jenis_perniagaan')->nullable();
            $table->enum('status_progress', ['draf', 'baru', 'menunggu bayaran proses', 'semakan bayaran proses', 'lawatan tapak', 'ulasan pegawai', 'ulasan pengarah', 'sokong dibawa ke mesyuarat', 'menunggu keputusan_mesyuarat', 'keputusan diperolehi', 'ditangguhkan'])->default('draf');
            $table->enum('status_mesyuarat', ['diluluskan','ditolak','dibatalkan','ditangguhkan'])->nullable();
            $table->string('kodkawasan')->nullable();
            $table->string('kodtaman')->nullable();
            $table->date('mulajanji')->nullable();
            $table->date('tamatjanji')->nullable();
            $table->date('tarikhmohon')->nullable();
            $table->date('tarikhlulus')->nullable();
            $table->datetime('dt_lesen_dikeluarkan')->nullable();
            $table->enum('group_laporan', ['penjaja sementara','penjaja statik','penjaja berpusat'])->nullable();  
            $table->integer('kpi')->nullable();
            $table->enum('patuh_kpi', ['0','1'])->nullable();            
            $table->date('lesen_dt_bayar')->nullable();
            $table->string('lesen_no_resit')->nullable();
            $table->double('lesen_amaun')->nullable();
            $table->datetime('lesen_grab')->nullable();
        });
    }

    /**
     * Reverse the migrations.
     */
    public function down(): void
    {
        //
        Schema::table('lesen_penjajas', function (Blueprint $table) {            
            $table->dropColumn('no_akaun_lesen');
            $table->dropColumn('no_fail_lesen');
            $table->dropColumn('kod_lesen');
            $table->dropColumn('jenis_perniagaan');
            $table->dropColumn('status_progress');
            $table->dropColumn('status_mesyuarat');
            $table->dropColumn('kodkawasan');
            $table->dropColumn('kodtaman');
            $table->dropColumn('mulajanji');
            $table->dropColumn('tamatjanji');
            $table->dropColumn('tarikhmohon');
            $table->dropColumn('tarikhlulus');
            $table->dropColumn('dt_lesen_dikeluarkan');
            $table->dropColumn('group_laporan');
            $table->dropColumn('kpi');
            $table->dropColumn('patuh_kpi');
            $table->dropColumn('lesen_dt_bayar');
            $table->dropColumn('lesen_no_resit');
            $table->dropColumn('lesen_amaun');
            $table->dropColumn('lesen_grab');
        });
    }
};
