Work on cards

This commit is contained in:
2023-12-08 23:54:21 +05:00
parent a4265e488c
commit 63e264805a
15 changed files with 299 additions and 98 deletions

View File

@@ -1,49 +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('card_orders', function (Blueprint $table) {
$table->id();
// $table->foreignId('user_id')->constrained('users')->restrictOnDelete();
// $table->string('cart_inception');
// $table->string('cart_type');
// $table->string('region');
// $table->foreignId('branch_id')->constrained('branches')->restrictOnDelete();
// $table->string('name');
// $table->string('surname');
// $table->string('patronic_name')->nullable();
// $table->date('born_at')->nullable();
// $table->string('old_surname')->nullable();
// $table->string('citizenship');
// $table->string('passport_serie');
// $table->integer('passport_number');
// $table->date('passport_given_at');
// $table->string('passport_given_by')->nullable();
// $table->string('born_location');
// $table->string('job_location')->nullable();
// $table->string('passport_address')->nullable();
// $table->string('home_address')->nullable();
// $table->string('phone')->nullable();
// $table->string('status')->nullable();
// $table->text('notes')->nullable();
$table->timestamps();
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('card_orders');
}
};

View File

@@ -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(): void
{
Schema::create('card_states', function (Blueprint $table) {
$table->id();
$table->jsonb('name');
$table->string('price')->nullable();
$table->timestamps();
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('card_states');
}
};

View File

@@ -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(): void
{
Schema::create('card_types', function (Blueprint $table) {
$table->id();
$table->jsonb('name');
$table->string('price')->nullable();
$table->timestamps();
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('card_types');
}
};

View File

@@ -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('loan_orders', function (Blueprint $table) {
$table->dropColumn('status_reason');
$table->dropColumn('filled_by');
$table->text('notes')->nullable()->change();
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::table('loan_orders', function (Blueprint $table) {
$table->string('status_reason')->nullable()->default('');
$table->foreignId('filled_by')->nullable()->constrained('users')->restrictOnDelete();
$table->string('notes')->nullable()->change();
});
}
};

View File

@@ -0,0 +1,67 @@
<?php
use App\Repos\Order\OrderRepo;
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('card_orders', function (Blueprint $table) {
$table->id();
$table->string('unique_id')->nullable()->unique();
$table->foreignId('card_state_id')->constrained()->restrictOnDelete();
$table->foreignId('card_type_id')->constrained()->restrictOnDelete();
$table->string('region', 2)->index();
$table->foreignId('branch_id')->constrained('branches')->restrictOnDelete();
$table->string('customer_name')->index();
$table->string('customer_surname')->index();
$table->string('customer_patronic_name')->nullable();
$table->date('born_at')->nullable();
$table->string('old_surname')->nullable();
$table->string('citizenship');
$table->string('passport_serie')->index();
$table->string('passport_id')->index();
$table->date('passport_given_at');
$table->string('passport_given_by');
$table->string('born_place');
$table->string('job_location')->nullable();
$table->string('passport_address')->nullable();
$table->string('real_address')->nullable();
$table->string('phone')->nullable()->index();
$table->string('phone_additional')->nullable()->index();
$table->string('status')->nullable()->default(OrderRepo::defaultStatus())->index();
$table->text('passport_one');
$table->text('passport_two');
$table->text('passport_three');
$table->text('passport_four');
$table->text('notes')->nullable();
$table->foreignId('user_id')->constrained('users')->restrictOnDelete();
$table->timestamps();
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('card_orders');
}
};