feat: Implement order and invoice management, enhance addon features, and remove the 'Type' module.

This commit is contained in:
pbao9
2026-02-11 17:02:07 +07:00
parent 58a9aa685b
commit 556b2c02e6
47 changed files with 1367 additions and 497 deletions
+14 -15
View File
@@ -4,8 +4,7 @@ use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
return new class extends Migration {
/**
* Run the migrations.
*
@@ -13,15 +12,18 @@ return new class extends Migration
*/
public function up()
{
Schema::create('product_addon',function (Blueprint $table){
$table->id()->autoIncrement();
$table->string('name',100)->nullable();
$table->integer('price')->nullable();
$table->integer('min')->nullable();
$table->integer('max')->nullable();
$table->integer('step')->nullable();
$table->string('prefix',50)->nullable();
$table->integer('type_id')->default(0)->index();
Schema::create('product_addon', function (Blueprint $table) {
$table->id();
$table->string('code', 50)->unique();
$table->string('name', 100);
$table->string('prefix', 50)->nullable();
$table->integer('min')->default(0);
$table->integer('max')->default(0);
$table->integer('step')->default(1);
$table->integer('price')->default(0);
$table->enum('input_type', ['number', 'slider', 'select'])
->default('number');
$table->boolean('status')->default(true);
$table->timestamps();
});
}
@@ -33,9 +35,6 @@ return new class extends Migration
*/
public function down()
{
Schema::table('addon',function (Blueprint $table) {
$table->dropForeign('group_id');
$table->drop();
});
Schema::dropIfExists('product_addon');
}
};
@@ -15,18 +15,6 @@ return new class extends Migration {
//
Schema::create('invoice_item', function (Blueprint $table) {
$table->id()->autoIncrement();
// $table->bigInteger('invoice_id')->default(0)->index();
// $table->bigInteger('customer_id')->default(0)->index();
// $table->tinyInteger('type_id')->default(0)->index();
// $table->integer('product_id')->nullable();
// $table->integer('billing')->nullable();
// $table->integer('parent_id')->nullable();
// $table->integer('relid')->nullable();
// $table->text('description')->nullable();
// $table->integer('amount')->nullable();
// $table->integer('tax')->default(1);
// $table->integer('due_date');
$table->bigInteger('invoice_id')->default(0)->index();
$table->unsignedBigInteger('product_id')->nullable()->index();
$table->integer('months')->default(0);