Compare commits
No commits in common. "a6b428e805c16805998418653ab074a4214e6de0" and "090a42348517bd58d8b009d81136c86c05484348" have entirely different histories.
a6b428e805
...
090a423485
|
|
@ -186,12 +186,9 @@ public function kirim(Request $request)
|
||||||
- Gunakan kalimat natural dan mengalir.
|
- Gunakan kalimat natural dan mengalir.
|
||||||
- Jangan terlalu panjang.
|
- Jangan terlalu panjang.
|
||||||
|
|
||||||
|
Jika user baru menyebut ingin cari rumah/properti:
|
||||||
Jika pengguna sudah memberikan informasi seperti budget, lokasi, tipe rumah, kategori, atau kebutuhan lainnya:
|
- Jangan langsung memberi rekomendasi properti.
|
||||||
- Langsung berikan rekomendasi properti yang paling sesuai.
|
- Tanya kebutuhan user dulu secara natural.
|
||||||
- Jangan mengulang pertanyaan yang sudah dijawab pengguna.
|
|
||||||
- Sertakan tag [REKOMENDASI:id].
|
|
||||||
- Jelaskan alasan singkat mengapa properti tersebut direkomendasikan.
|
|
||||||
|
|
||||||
Contoh gaya yang BENAR:
|
Contoh gaya yang BENAR:
|
||||||
'Siap kak 😊
|
'Siap kak 😊
|
||||||
|
|
@ -280,7 +277,7 @@ public function kirim(Request $request)
|
||||||
// =========================
|
// =========================
|
||||||
if (
|
if (
|
||||||
preg_match(
|
preg_match(
|
||||||
'/\[REKOMENDASI:\s*([\d,\s]+)\]/',
|
'/\[REKOMENDASI:([\d,]+)\]/',
|
||||||
$balasan,
|
$balasan,
|
||||||
$matches
|
$matches
|
||||||
)
|
)
|
||||||
|
|
@ -310,8 +307,7 @@ public function kirim(Request $request)
|
||||||
'luas_tanah',
|
'luas_tanah',
|
||||||
'stok_unit'
|
'stok_unit'
|
||||||
)
|
)
|
||||||
->limit(2)
|
->get(1)
|
||||||
->get()
|
|
||||||
->toArray();
|
->toArray();
|
||||||
|
|
||||||
// hapus tag dari chat
|
// hapus tag dari chat
|
||||||
|
|
|
||||||
|
|
@ -264,7 +264,7 @@ public function update(Request $request, $id)
|
||||||
|
|
||||||
// KHUSUS PELUNASAN
|
// KHUSUS PELUNASAN
|
||||||
if (
|
if (
|
||||||
strtolower($request->tahap_saat_ini) == 'pelunasan pembayaran' &&
|
strtolower($request->tahap_saat_ini) == 'pelunasan' &&
|
||||||
$request->status != 'Selesai'
|
$request->status != 'Selesai'
|
||||||
) {
|
) {
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,49 @@
|
||||||
|
<?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('users', function (Blueprint $table) {
|
||||||
|
$table->id();
|
||||||
|
$table->string('name');
|
||||||
|
$table->string('email')->unique();
|
||||||
|
$table->timestamp('email_verified_at')->nullable();
|
||||||
|
$table->string('password');
|
||||||
|
$table->rememberToken();
|
||||||
|
$table->timestamps();
|
||||||
|
});
|
||||||
|
|
||||||
|
Schema::create('password_reset_tokens', function (Blueprint $table) {
|
||||||
|
$table->string('email')->primary();
|
||||||
|
$table->string('token');
|
||||||
|
$table->timestamp('created_at')->nullable();
|
||||||
|
});
|
||||||
|
|
||||||
|
Schema::create('sessions', function (Blueprint $table) {
|
||||||
|
$table->string('id')->primary();
|
||||||
|
$table->foreignId('user_id')->nullable()->index();
|
||||||
|
$table->string('ip_address', 45)->nullable();
|
||||||
|
$table->text('user_agent')->nullable();
|
||||||
|
$table->longText('payload');
|
||||||
|
$table->integer('last_activity')->index();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Reverse the migrations.
|
||||||
|
*/
|
||||||
|
public function down(): void
|
||||||
|
{
|
||||||
|
Schema::dropIfExists('users');
|
||||||
|
Schema::dropIfExists('password_reset_tokens');
|
||||||
|
Schema::dropIfExists('sessions');
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
@ -1,47 +0,0 @@
|
||||||
<?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('user', function (Blueprint $table) {
|
|
||||||
|
|
||||||
$table->increments('id_user');
|
|
||||||
|
|
||||||
$table->string('nama_user');
|
|
||||||
$table->string('no_hp', 15);
|
|
||||||
|
|
||||||
$table->string('email_user')->unique();
|
|
||||||
|
|
||||||
$table->string('password_user', 100);
|
|
||||||
|
|
||||||
$table->enum('role_user', [
|
|
||||||
'admin',
|
|
||||||
'customer'
|
|
||||||
]);
|
|
||||||
|
|
||||||
$table->string('profile_photo')->nullable();
|
|
||||||
|
|
||||||
$table->timestamps();
|
|
||||||
|
|
||||||
$table->string('google_id')->nullable();
|
|
||||||
$table->text('google_avatar')->nullable();
|
|
||||||
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Reverse the migrations.
|
|
||||||
*/
|
|
||||||
public function down(): void
|
|
||||||
{
|
|
||||||
Schema::dropIfExists('user');
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
@ -6,6 +6,9 @@
|
||||||
|
|
||||||
return new class extends Migration
|
return new class extends Migration
|
||||||
{
|
{
|
||||||
|
/**
|
||||||
|
* Run the migrations.
|
||||||
|
*/
|
||||||
public function up(): void
|
public function up(): void
|
||||||
{
|
{
|
||||||
Schema::create('visitor_logs', function (Blueprint $table) {
|
Schema::create('visitor_logs', function (Blueprint $table) {
|
||||||
|
|
@ -17,11 +20,15 @@ public function up(): void
|
||||||
$table->string('page')->nullable();
|
$table->string('page')->nullable();
|
||||||
|
|
||||||
$table->timestamps();
|
$table->timestamps();
|
||||||
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Reverse the migrations.
|
||||||
|
*/
|
||||||
public function down(): void
|
public function down(): void
|
||||||
{
|
{
|
||||||
Schema::dropIfExists('visitor_logs');
|
Schema::dropIfExists('visitor_logs_');
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
@ -0,0 +1,29 @@
|
||||||
|
<?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()
|
||||||
|
{
|
||||||
|
Schema::table('user', function ($table) {
|
||||||
|
$table->string('google_id')->nullable();
|
||||||
|
$table->text('google_avatar')->nullable();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Reverse the migrations.
|
||||||
|
*/
|
||||||
|
public function down(): void
|
||||||
|
{
|
||||||
|
Schema::table('user', function (Blueprint $table) {
|
||||||
|
//
|
||||||
|
});
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
@ -0,0 +1,23 @@
|
||||||
|
<?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::table('dokumen', function (Blueprint $table) {
|
||||||
|
$table->unsignedBigInteger('id_transaksi')
|
||||||
|
->after('id_user');
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
public function down(): void
|
||||||
|
{
|
||||||
|
Schema::table('dokumen', function (Blueprint $table) {
|
||||||
|
$table->dropColumn('id_transaksi');
|
||||||
|
});
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
@ -6,31 +6,36 @@
|
||||||
|
|
||||||
return new class extends Migration
|
return new class extends Migration
|
||||||
{
|
{
|
||||||
|
/**
|
||||||
|
* Run the migrations.
|
||||||
|
*/
|
||||||
public function up(): void
|
public function up(): void
|
||||||
{
|
{
|
||||||
Schema::create('log_aktivitas', function (Blueprint $table) {
|
Schema::create('log_aktivitas', function (Blueprint $table) {
|
||||||
|
|
||||||
$table->id();
|
$table->id();
|
||||||
|
|
||||||
$table->unsignedInteger('id_user')->nullable();
|
// HARUS SAMA: INT (bukan bigInteger)
|
||||||
|
$table->integer('id_user')->nullable();
|
||||||
$table->string('aktivitas');
|
|
||||||
|
|
||||||
$table->string('icon')->nullable();
|
|
||||||
|
|
||||||
$table->string('tipe')->nullable();
|
|
||||||
|
|
||||||
$table->unsignedBigInteger('ref_id')->nullable();
|
|
||||||
|
|
||||||
$table->timestamps();
|
|
||||||
|
|
||||||
$table->foreign('id_user')
|
$table->foreign('id_user')
|
||||||
->references('id_user')
|
->references('id_user')
|
||||||
->on('user')
|
->on('user')
|
||||||
->nullOnDelete();
|
->onDelete('set null');
|
||||||
|
|
||||||
|
$table->string('aktivitas');
|
||||||
|
$table->string('icon')->nullable();
|
||||||
|
$table->string('tipe')->nullable();
|
||||||
|
$table->unsignedBigInteger('ref_id')->nullable();
|
||||||
|
|
||||||
|
$table->timestamps();
|
||||||
|
|
||||||
|
$table->index('id_user');
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Reverse the migrations.
|
||||||
|
*/
|
||||||
public function down(): void
|
public function down(): void
|
||||||
{
|
{
|
||||||
Schema::dropIfExists('log_aktivitas');
|
Schema::dropIfExists('log_aktivitas');
|
||||||
|
|
@ -0,0 +1,32 @@
|
||||||
|
<?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('chat_messages', function (Blueprint $table) {
|
||||||
|
|
||||||
|
$table->json('properti_data')
|
||||||
|
->nullable()
|
||||||
|
->after('message');
|
||||||
|
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Reverse the migrations.
|
||||||
|
*/
|
||||||
|
public function down(): void
|
||||||
|
{
|
||||||
|
Schema::table('chat_messages', function (Blueprint $table) {
|
||||||
|
//
|
||||||
|
});
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
@ -6,17 +6,16 @@
|
||||||
|
|
||||||
return new class extends Migration
|
return new class extends Migration
|
||||||
{
|
{
|
||||||
|
/**
|
||||||
|
* Run the migrations.
|
||||||
|
*/
|
||||||
public function up(): void
|
public function up(): void
|
||||||
{
|
{
|
||||||
Schema::create('gambar_properti', function (Blueprint $table) {
|
Schema::create('gambar_properti', function (Blueprint $table) {
|
||||||
$table->id('id_gambar');
|
$table->id('id_gambar');
|
||||||
|
$table->unsignedBigInteger('id_properti');
|
||||||
$table->unsignedInteger('id_properti');
|
|
||||||
|
|
||||||
$table->string('path_gambar');
|
$table->string('path_gambar');
|
||||||
|
|
||||||
$table->timestamps();
|
$table->timestamps();
|
||||||
|
|
||||||
$table->foreign('id_properti')
|
$table->foreign('id_properti')
|
||||||
->references('id_properti')
|
->references('id_properti')
|
||||||
->on('properti')
|
->on('properti')
|
||||||
|
|
@ -24,6 +23,9 @@ public function up(): void
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Reverse the migrations.
|
||||||
|
*/
|
||||||
public function down(): void
|
public function down(): void
|
||||||
{
|
{
|
||||||
Schema::dropIfExists('gambar_properti');
|
Schema::dropIfExists('gambar_properti');
|
||||||
|
|
@ -1,32 +0,0 @@
|
||||||
<?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('perumahan', function (Blueprint $table) {
|
|
||||||
$table->increments('id_perumahan');
|
|
||||||
|
|
||||||
$table->string('nama_perumahan');
|
|
||||||
$table->string('lokasi_perumahan');
|
|
||||||
|
|
||||||
$table->decimal('latitude', 10, 7)->nullable();
|
|
||||||
$table->decimal('longitude', 10, 7)->nullable();
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Reverse the migrations.
|
|
||||||
*/
|
|
||||||
public function down(): void
|
|
||||||
{
|
|
||||||
Schema::dropIfExists('perumahan');
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
@ -1,38 +0,0 @@
|
||||||
<?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('blok', function (Blueprint $table) {
|
|
||||||
|
|
||||||
$table->increments('id_blok');
|
|
||||||
|
|
||||||
$table->unsignedInteger('id_perumahan');
|
|
||||||
|
|
||||||
$table->string('nama_blok', 50);
|
|
||||||
|
|
||||||
$table->foreign('id_perumahan')
|
|
||||||
->references('id_perumahan')
|
|
||||||
->on('perumahan')
|
|
||||||
->cascadeOnUpdate()
|
|
||||||
->cascadeOnDelete();
|
|
||||||
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Reverse the migrations.
|
|
||||||
*/
|
|
||||||
public function down(): void
|
|
||||||
{
|
|
||||||
Schema::dropIfExists('blok');
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
@ -1,81 +0,0 @@
|
||||||
<?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('properti', function (Blueprint $table) {
|
|
||||||
|
|
||||||
$table->increments('id_properti');
|
|
||||||
|
|
||||||
$table->unsignedInteger('id_perumahan');
|
|
||||||
$table->unsignedInteger('id_blok');
|
|
||||||
|
|
||||||
$table->string('nama_properti');
|
|
||||||
|
|
||||||
$table->enum('jenis_properti', [
|
|
||||||
'rumah',
|
|
||||||
'ruko'
|
|
||||||
]);
|
|
||||||
|
|
||||||
$table->enum('kategori_properti', [
|
|
||||||
'subsidi',
|
|
||||||
'komersial'
|
|
||||||
]);
|
|
||||||
|
|
||||||
$table->enum('tipe_properti', [
|
|
||||||
'30/60',
|
|
||||||
'36/72',
|
|
||||||
'45/84',
|
|
||||||
'60/135',
|
|
||||||
'Ruko'
|
|
||||||
]);
|
|
||||||
|
|
||||||
$table->decimal('harga_properti', 15, 2);
|
|
||||||
|
|
||||||
$table->bigInteger('bookingFee');
|
|
||||||
|
|
||||||
$table->decimal('luas_bangunan', 6, 2);
|
|
||||||
|
|
||||||
$table->decimal('luas_tanah', 6, 2);
|
|
||||||
|
|
||||||
$table->unsignedInteger('stok_unit');
|
|
||||||
|
|
||||||
$table->enum('status_unit', [
|
|
||||||
'tersedia',
|
|
||||||
'dipesan',
|
|
||||||
'terjual'
|
|
||||||
]);
|
|
||||||
|
|
||||||
$table->timestamps();
|
|
||||||
|
|
||||||
$table->foreign('id_perumahan')
|
|
||||||
->references('id_perumahan')
|
|
||||||
->on('perumahan')
|
|
||||||
->cascadeOnUpdate()
|
|
||||||
->cascadeOnDelete();
|
|
||||||
|
|
||||||
$table->foreign('id_blok')
|
|
||||||
->references('id_blok')
|
|
||||||
->on('blok')
|
|
||||||
->cascadeOnUpdate()
|
|
||||||
->cascadeOnDelete();
|
|
||||||
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Reverse the migrations.
|
|
||||||
*/
|
|
||||||
public function down(): void
|
|
||||||
{
|
|
||||||
Schema::dropIfExists('properti');
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
@ -1,87 +0,0 @@
|
||||||
<?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('transaksi', function (Blueprint $table) {
|
|
||||||
|
|
||||||
$table->increments('id_transaksi');
|
|
||||||
|
|
||||||
$table->unsignedInteger('id_properti');
|
|
||||||
$table->unsignedInteger('id_user');
|
|
||||||
|
|
||||||
$table->date('tanggal_transaksi');
|
|
||||||
|
|
||||||
$table->decimal('total_harga', 15, 2);
|
|
||||||
|
|
||||||
$table->enum('jenis_transaksi', [
|
|
||||||
'lunas',
|
|
||||||
'kredit',
|
|
||||||
'KPR'
|
|
||||||
]);
|
|
||||||
|
|
||||||
$table->enum('metode_pembayaran', [
|
|
||||||
'transfer_bank',
|
|
||||||
'virtual_account',
|
|
||||||
'qris_ewallet'
|
|
||||||
]);
|
|
||||||
|
|
||||||
$table->enum('bank_pengirim', [
|
|
||||||
'bca',
|
|
||||||
'mandiri',
|
|
||||||
'bni',
|
|
||||||
'bri',
|
|
||||||
'gopay',
|
|
||||||
'ovo',
|
|
||||||
'dana',
|
|
||||||
'bca_va',
|
|
||||||
'mandiri_va',
|
|
||||||
'bni_va'
|
|
||||||
])->nullable();
|
|
||||||
|
|
||||||
$table->date('tanggal_transfer')->nullable();
|
|
||||||
|
|
||||||
$table->enum('status_transaksi', [
|
|
||||||
'menunggu_pembayaran',
|
|
||||||
'menunggu_verifikasi',
|
|
||||||
'berhasil',
|
|
||||||
'ditolak',
|
|
||||||
'perlu_upload_ulang',
|
|
||||||
'pending'
|
|
||||||
]);
|
|
||||||
|
|
||||||
$table->string('bukti_transaksi')->nullable();
|
|
||||||
|
|
||||||
$table->timestamps();
|
|
||||||
|
|
||||||
$table->foreign('id_properti')
|
|
||||||
->references('id_properti')
|
|
||||||
->on('properti')
|
|
||||||
->cascadeOnUpdate()
|
|
||||||
->cascadeOnDelete();
|
|
||||||
|
|
||||||
$table->foreign('id_user')
|
|
||||||
->references('id_user')
|
|
||||||
->on('user')
|
|
||||||
->cascadeOnUpdate()
|
|
||||||
->cascadeOnDelete();
|
|
||||||
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Reverse the migrations.
|
|
||||||
*/
|
|
||||||
public function down(): void
|
|
||||||
{
|
|
||||||
Schema::dropIfExists('transaksi');
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
@ -1,79 +0,0 @@
|
||||||
<?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('pemesanan', function (Blueprint $table) {
|
|
||||||
|
|
||||||
$table->increments('id_pemesanan');
|
|
||||||
|
|
||||||
$table->unsignedInteger('id_user');
|
|
||||||
$table->unsignedInteger('id_properti');
|
|
||||||
$table->unsignedInteger('id_transaksi')->nullable();
|
|
||||||
|
|
||||||
$table->string('kode_pemesanan',20)->unique();
|
|
||||||
|
|
||||||
$table->enum('metode_pembayaran',[
|
|
||||||
'kredit',
|
|
||||||
'Lunas'
|
|
||||||
]);
|
|
||||||
|
|
||||||
$table->string('tahap_saat_ini');
|
|
||||||
|
|
||||||
$table->enum('status',[
|
|
||||||
'Proses',
|
|
||||||
'Selesai',
|
|
||||||
'Ditolak'
|
|
||||||
])->default('Proses');
|
|
||||||
|
|
||||||
$table->decimal('total_harga',15,2);
|
|
||||||
|
|
||||||
$table->dateTime('tanggal_pemesanan')->useCurrent();
|
|
||||||
|
|
||||||
$table->string('estimasi_proses')->nullable();
|
|
||||||
|
|
||||||
$table->text('catatan_admin')->nullable();
|
|
||||||
|
|
||||||
$table->timestamp('created_at')->useCurrent();
|
|
||||||
|
|
||||||
$table->timestamp('updated_at')
|
|
||||||
->useCurrent()
|
|
||||||
->useCurrentOnUpdate();
|
|
||||||
|
|
||||||
$table->foreign('id_user')
|
|
||||||
->references('id_user')
|
|
||||||
->on('user')
|
|
||||||
->cascadeOnUpdate()
|
|
||||||
->cascadeOnDelete();
|
|
||||||
|
|
||||||
$table->foreign('id_properti')
|
|
||||||
->references('id_properti')
|
|
||||||
->on('properti')
|
|
||||||
->cascadeOnUpdate()
|
|
||||||
->cascadeOnDelete();
|
|
||||||
|
|
||||||
$table->foreign('id_transaksi')
|
|
||||||
->references('id_transaksi')
|
|
||||||
->on('transaksi')
|
|
||||||
->cascadeOnUpdate()
|
|
||||||
->cascadeOnDelete();
|
|
||||||
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Reverse the migrations.
|
|
||||||
*/
|
|
||||||
public function down(): void
|
|
||||||
{
|
|
||||||
Schema::dropIfExists('pemesanan');
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
@ -1,100 +0,0 @@
|
||||||
<?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('dokumen', function (Blueprint $table) {
|
|
||||||
|
|
||||||
$table->increments('id_dokumen');
|
|
||||||
|
|
||||||
$table->unsignedInteger('id_user');
|
|
||||||
|
|
||||||
$table->unsignedInteger('id_pemesanan')->nullable();
|
|
||||||
|
|
||||||
$table->unsignedInteger('id_transaksi')->nullable();
|
|
||||||
|
|
||||||
$table->enum('jenis_dokumen',[
|
|
||||||
'ktp',
|
|
||||||
'kk',
|
|
||||||
'surat_nikah',
|
|
||||||
'npwp',
|
|
||||||
'slip_gaji',
|
|
||||||
'surat_keterangan_kerja',
|
|
||||||
'rekening_koran',
|
|
||||||
'spt_pajak',
|
|
||||||
'siup',
|
|
||||||
'surat_keterangan_usaha',
|
|
||||||
'pembukuan_usaha',
|
|
||||||
'selfie',
|
|
||||||
'foto_lokasi_usaha',
|
|
||||||
'foto_tempat_kerja',
|
|
||||||
'foto_3x4',
|
|
||||||
'surat_kerja',
|
|
||||||
'bukti_booking',
|
|
||||||
'dokumen_admin',
|
|
||||||
'surat_penghasilan_usaha',
|
|
||||||
'bukti_pembayaran'
|
|
||||||
]);
|
|
||||||
|
|
||||||
$table->string('nama_file');
|
|
||||||
|
|
||||||
$table->string('path_file');
|
|
||||||
|
|
||||||
$table->string('tipe_file',50);
|
|
||||||
|
|
||||||
$table->bigInteger('ukuran_file');
|
|
||||||
|
|
||||||
$table->enum('status_verifikasi',[
|
|
||||||
'pending',
|
|
||||||
'diterima',
|
|
||||||
'revisi',
|
|
||||||
'ditolak'
|
|
||||||
]);
|
|
||||||
|
|
||||||
$table->text('catatan_verifikasi')->nullable();
|
|
||||||
|
|
||||||
$table->timestamp('uploaded_at')->useCurrent();
|
|
||||||
|
|
||||||
$table->timestamp('verified_at')->nullable();
|
|
||||||
|
|
||||||
$table->enum('sumber_dokumen',[
|
|
||||||
'pelanggan',
|
|
||||||
'admin'
|
|
||||||
])->default('pelanggan');
|
|
||||||
|
|
||||||
$table->foreign('id_user')
|
|
||||||
->references('id_user')
|
|
||||||
->on('user')
|
|
||||||
->cascadeOnUpdate()
|
|
||||||
->cascadeOnDelete();
|
|
||||||
|
|
||||||
$table->foreign('id_pemesanan')
|
|
||||||
->references('id_pemesanan')
|
|
||||||
->on('pemesanan')
|
|
||||||
->cascadeOnDelete();
|
|
||||||
|
|
||||||
$table->foreign('id_transaksi')
|
|
||||||
->references('id_transaksi')
|
|
||||||
->on('transaksi')
|
|
||||||
->cascadeOnUpdate()
|
|
||||||
->cascadeOnDelete();
|
|
||||||
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Reverse the migrations.
|
|
||||||
*/
|
|
||||||
public function down(): void
|
|
||||||
{
|
|
||||||
Schema::dropIfExists('dokumen');
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
@ -1,71 +0,0 @@
|
||||||
<?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('notifikasi', function (Blueprint $table) {
|
|
||||||
|
|
||||||
$table->increments('id_notifikasi');
|
|
||||||
|
|
||||||
$table->unsignedInteger('id_user');
|
|
||||||
|
|
||||||
$table->string('judul')->nullable();
|
|
||||||
|
|
||||||
$table->text('pesan')->nullable();
|
|
||||||
|
|
||||||
$table->enum('tipe', [
|
|
||||||
'tagihan',
|
|
||||||
'pembayaran',
|
|
||||||
'dokumen',
|
|
||||||
'info',
|
|
||||||
'transaksi',
|
|
||||||
'verifikasi',
|
|
||||||
'monitoring',
|
|
||||||
'pelunasan'
|
|
||||||
])->nullable();
|
|
||||||
|
|
||||||
$table->boolean('status_baca')->default(false);
|
|
||||||
|
|
||||||
$table->enum('status_kirim', [
|
|
||||||
'pending',
|
|
||||||
'terkirim',
|
|
||||||
'gagal'
|
|
||||||
])->nullable();
|
|
||||||
|
|
||||||
$table->enum('channel', [
|
|
||||||
'in_app',
|
|
||||||
'email',
|
|
||||||
'whatsapp'
|
|
||||||
])->nullable();
|
|
||||||
|
|
||||||
$table->integer('referensi_id')->nullable();
|
|
||||||
|
|
||||||
$table->string('referensi_tipe',50)->nullable();
|
|
||||||
|
|
||||||
$table->timestamp('created_at')->useCurrent();
|
|
||||||
|
|
||||||
$table->foreign('id_user')
|
|
||||||
->references('id_user')
|
|
||||||
->on('user')
|
|
||||||
->cascadeOnUpdate()
|
|
||||||
->cascadeOnDelete();
|
|
||||||
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Reverse the migrations.
|
|
||||||
*/
|
|
||||||
public function down(): void
|
|
||||||
{
|
|
||||||
Schema::dropIfExists('notifikasi');
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
@ -1,46 +0,0 @@
|
||||||
<?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('chat_sessions', function (Blueprint $table) {
|
|
||||||
|
|
||||||
$table->increments('id_sessions');
|
|
||||||
|
|
||||||
$table->unsignedInteger('id_user')->nullable();
|
|
||||||
|
|
||||||
$table->enum('status_chat', [
|
|
||||||
'aktif',
|
|
||||||
'selesai',
|
|
||||||
'pending'
|
|
||||||
]);
|
|
||||||
|
|
||||||
$table->timestamp('started_at')->nullable();
|
|
||||||
|
|
||||||
$table->timestamp('ended_at')->useCurrent();
|
|
||||||
|
|
||||||
$table->foreign('id_user')
|
|
||||||
->references('id_user')
|
|
||||||
->on('user')
|
|
||||||
->cascadeOnUpdate()
|
|
||||||
->cascadeOnDelete();
|
|
||||||
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Reverse the migrations.
|
|
||||||
*/
|
|
||||||
public function down(): void
|
|
||||||
{
|
|
||||||
Schema::dropIfExists('chat_sessions');
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
@ -1,48 +0,0 @@
|
||||||
<?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('chat_messages', function (Blueprint $table) {
|
|
||||||
|
|
||||||
$table->increments('id_messages');
|
|
||||||
|
|
||||||
$table->unsignedInteger('id_sessions');
|
|
||||||
|
|
||||||
$table->enum('sender', [
|
|
||||||
'user',
|
|
||||||
'bot',
|
|
||||||
'admin'
|
|
||||||
]);
|
|
||||||
|
|
||||||
$table->text('message');
|
|
||||||
|
|
||||||
$table->json('properti_data')->nullable();
|
|
||||||
|
|
||||||
$table->dateTime('created_at')->useCurrent();
|
|
||||||
|
|
||||||
$table->foreign('id_sessions')
|
|
||||||
->references('id_sessions')
|
|
||||||
->on('chat_sessions')
|
|
||||||
->cascadeOnUpdate()
|
|
||||||
->cascadeOnDelete();
|
|
||||||
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Reverse the migrations.
|
|
||||||
*/
|
|
||||||
public function down(): void
|
|
||||||
{
|
|
||||||
Schema::dropIfExists('chat_messages');
|
|
||||||
}
|
|
||||||
};
|
|
||||||
Loading…
Reference in New Issue