40 lines
1.7 KiB
PHP
40 lines
1.7 KiB
PHP
<?php
|
|
|
|
use Illuminate\Database\Migrations\Migration;
|
|
use Illuminate\Database\Schema\Blueprint;
|
|
use Illuminate\Support\Facades\Schema;
|
|
|
|
return new class extends Migration
|
|
{
|
|
public function up(): void
|
|
{
|
|
Schema::create('permohonan', function (Blueprint $table) {
|
|
$table->id();
|
|
$table->string('no_rujukan')->unique();
|
|
$table->foreignId('user_id')->constrained()->cascadeOnDelete();
|
|
$table->foreignId('jabatan_id')->nullable()->constrained('jabatan')->nullOnDelete();
|
|
$table->foreignId('vot_id')->nullable()->constrained('vot')->nullOnDelete();
|
|
$table->string('kategori');
|
|
$table->text('tujuan');
|
|
$table->decimal('jumlah_keseluruhan', 14, 2)->default(0);
|
|
$table->enum('status', ['Draft', 'Submitted', 'Under Review', 'Accepted', 'Rejected', 'Approved'])->default('Draft');
|
|
$table->text('catatan')->nullable();
|
|
$table->string('gambar_1')->nullable();
|
|
$table->string('gambar_2')->nullable();
|
|
$table->enum('status_semakan', ['Belum Disemak', 'Sedang Disemak', 'Selesai'])->default('Belum Disemak');
|
|
$table->text('catatan_semakan')->nullable();
|
|
$table->foreignId('reviewed_by')->nullable()->constrained('users')->nullOnDelete();
|
|
$table->timestamp('reviewed_at')->nullable();
|
|
$table->foreignId('approved_by')->nullable()->constrained('users')->nullOnDelete();
|
|
$table->timestamp('approved_at')->nullable();
|
|
$table->timestamp('submitted_at')->nullable();
|
|
$table->timestamps();
|
|
});
|
|
}
|
|
|
|
public function down(): void
|
|
{
|
|
Schema::dropIfExists('permohonan');
|
|
}
|
|
};
|