<?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('services', function (Blueprint $table) {
            $table->id();
            $table->foreignId('user_id')->constrained();
            $table->enum('jenis_permintaan', ['Pengambilan Contoh Uji', 'Pengambilan dan Pengujian Contoh Uji']);
            $table->date('tanggal_uji');
            $table->string('parameter');
            $table->enum('pengujian_kualitas_air', ['Air Limbah', 'Air Bersih', 'Air Badan Air']);
            $table->integer('total_sampel');
            $table->enum('jarak_pengambilan_sampel', ['jarak < 100km', 'jarak 100km - 150km', 'jarak > 150km']);
            $table->enum('status', ['Menunggu', 'Diterima', 'Diproses', 'Selesai'])->default('Menunggu')->nullable();
            $table->date('tanggal_selesai_uji')->nullable();
            $table->integer('biaya_retribusi_parameter')->nullable();
            $table->integer('biaya_retribusi_jarak')->nullable();
            $table->integer('biaya_retribusi')->nullable();
            $table->string('file_hasil_uji')->nullable();
            $table->timestamps();
        });
    }

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