<?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('pemasukan', function (Blueprint $table) {
            $table->id();
            $table->date('tanggal');
            $table->string('kategori'); // uang / barang
            $table->string('nama');
            // $table->string('email')->nullable(); // email donatur
            $table->integer('jumlah'); // jika uang, maka jumlah uang; jika barang, harga satuan
            $table->integer('harga')->nullable();; // jika uang, maka jumlah uang; jika barang, harga satuan
            $table->string('keterangan')->nullable(); // hanya untuk barang
            $table->integer('quantity')->nullable(); // hanya untuk barang
            $table->string('bukti')->nullable(); // path bukti upload gambar
            // $table->string('status')->default('menunggu'); // status: menunggu / acc
            $table->timestamps();
        });
    }

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