account section

This commit is contained in:
Abhishek Mali
2025-11-21 16:07:43 +05:30
parent 63daef6a92
commit 6e1ae8f380
17 changed files with 1633 additions and 1001 deletions

View File

@@ -0,0 +1,46 @@
<?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('entries', function (Blueprint $table) {
$table->id();
$table->string('entry_no')->unique(); // PAY-2024-001
$table->string('description');
$table->string('region');
$table->unsignedInteger('order_quantity')->default(0); // selected consolidated order count
$table->decimal('amount', 12, 2);
$table->decimal('pending_amount', 12, 2); // always <= amount
$table->date('entry_date'); // auto-today default by controller
// Toggle-based payment states
$table->enum('payment_status', ['unpaid', 'pending', 'paid'])->default('unpaid');
$table->tinyInteger('toggle_pos')->default(0); // 0 left, 1 middle, 2 right
// Dispatch state (for second table)
$table->enum('dispatch_status', [
'pending',
'loading',
'packed',
'dispatched',
'delivered'
])->default('pending');
$table->timestamps();
});
}
public function down(): void
{
Schema::dropIfExists('entries');
}
};

View File

@@ -0,0 +1,40 @@
<?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('installments', function (Blueprint $table) {
$table->id();
$table->foreignId('entry_id')
->constrained('entries')
->onDelete('cascade');
$table->date('proc_date'); // processing date
$table->decimal('amount', 12, 2);
$table->string('description')->nullable();
$table->string('region')->nullable();
$table->enum('status', [
'Pending',
'Loading',
'Packed',
'Dispatched',
'Delivered'
])->default('Pending');
$table->timestamps();
});
}
public function down(): void
{
Schema::dropIfExists('installments');
}
};

View File

@@ -0,0 +1,30 @@
<?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('entry_order', function (Blueprint $table) {
$table->id();
$table->foreignId('entry_id')
->constrained('entries')
->onDelete('cascade');
$table->foreignId('order_id')
->constrained('orders')
->onDelete('cascade');
$table->timestamps();
});
}
public function down(): void
{
Schema::dropIfExists('entry_order');
}
};