change copperConvertPage

This commit is contained in:
2026-11-01 12:42:14 +03:30
parent 9528056036
commit 3f59af5a6d
10 changed files with 495 additions and 3 deletions
@@ -0,0 +1,43 @@
<?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
{
if (Schema::hasTable('copper_convert_requests')) {
return;
}
Schema::create('copper_convert_requests', function (Blueprint $table) {
$table->id();
$table->unsignedBigInteger('customer_id')->index();
$table->string('status', 20)->default('pending')->index();
$table->string('source', 20);
$table->unsignedBigInteger('source_product_id');
$table->string('asset_unit', 32);
$table->decimal('consumed_amount', 16, 4);
$table->decimal('leftover_amount', 16, 4)->default(0);
$table->unsignedBigInteger('source_unit_price');
$table->unsignedBigInteger('wire15_product_id')->nullable();
$table->unsignedInteger('wire15_rings')->default(0);
$table->unsignedBigInteger('wire15_unit_price')->default(0);
$table->unsignedBigInteger('wire25_product_id')->nullable();
$table->unsignedInteger('wire25_rings')->default(0);
$table->unsignedBigInteger('wire25_unit_price')->default(0);
$table->unsignedBigInteger('sell_order_id')->nullable();
$table->unsignedBigInteger('buy15_order_id')->nullable();
$table->unsignedBigInteger('buy25_order_id')->nullable();
$table->unsignedBigInteger('admin_id')->nullable();
$table->timestamps();
});
}
public function down(): void
{
Schema::dropIfExists('copper_convert_requests');
}
};