update
This commit is contained in:
1 parent
ec2a6facc0
commit
264ed50e92
7 files changed
+892
-4
No files matched your search
@@ -0,0 +1,48 @@
|
||||
<?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('guests', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->string('loyalty_id')->unique();
|
||||
$table->string('first_name');
|
||||
$table->string('last_name');
|
||||
$table->string('email')->nullable();
|
||||
$table->string('phone')->nullable();
|
||||
$table->date('date_of_birth')->nullable();
|
||||
$table->enum('gender', ['male', 'female', 'other'])->nullable();
|
||||
$table->string('nationality')->nullable();
|
||||
$table->text('address')->nullable();
|
||||
$table->string('passport_number')->nullable();
|
||||
$table->date('passport_expiry')->nullable();
|
||||
$table->string('preferred_language')->default('en');
|
||||
$table->json('preferences')->nullable();
|
||||
$table->foreignId('loyalty_tier_id')->nullable()->constrained()->onDelete('set null');
|
||||
$table->integer('total_points')->default(0);
|
||||
$table->decimal('total_spend', 12, 2)->default(0);
|
||||
$table->integer('visit_count')->default(0);
|
||||
$table->datetime('last_visit_at')->nullable();
|
||||
$table->datetime('first_visit_at')->nullable();
|
||||
$table->enum('status', ['active', 'inactive', 'blacklisted'])->default('active');
|
||||
$table->text('notes')->nullable();
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('guests');
|
||||
}
|
||||
};
|
||||
Binary file not shown.
@@ -0,0 +1,37 @@
|
||||
<?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('issued_vouchers', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->foreignId('voucher_id')->constrained()->onDelete('cascade');
|
||||
$table->foreignId('guest_id')->constrained()->onDelete('cascade');
|
||||
$table->foreignId('issued_by')->constrained('users')->onDelete('cascade');
|
||||
$table->string('voucher_code')->unique();
|
||||
$table->decimal('value', 8, 2);
|
||||
$table->datetime('issued_at');
|
||||
$table->datetime('expires_at')->nullable();
|
||||
$table->datetime('used_at')->nullable();
|
||||
$table->enum('status', ['active', 'used', 'expired', 'cancelled'])->default('active');
|
||||
$table->text('notes')->nullable();
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('issued_vouchers');
|
||||
}
|
||||
};
|
||||
Reference in new issue
Block a user