diff --git a/database/migrations/2026_02_04_221050_create_trading_partners_table.php b/database/migrations/2026_02_04_221050_create_trading_partners_table.php new file mode 100644 index 0000000..4e97a60 --- /dev/null +++ b/database/migrations/2026_02_04_221050_create_trading_partners_table.php @@ -0,0 +1,36 @@ +id(); + $table->unsignedBigInteger('tenant_id'); + $table->string('name', 100); + $table->string('type', 20)->default('vendor'); + $table->string('category', 50)->default('기타'); + $table->string('biz_no', 20)->nullable(); + $table->string('bank_account', 100)->nullable(); + $table->string('contact', 50)->nullable(); + $table->string('email', 100)->nullable(); + $table->string('manager', 50)->nullable(); + $table->string('manager_phone', 20)->nullable(); + $table->string('status', 20)->default('active'); + $table->text('memo')->nullable(); + $table->timestamps(); + $table->softDeletes(); + $table->index(['tenant_id', 'status']); + $table->index(['tenant_id', 'type']); + }); + } + + public function down(): void + { + Schema::dropIfExists('trading_partners'); + } +}; diff --git a/database/migrations/2026_02_04_222005_create_receivables_table.php b/database/migrations/2026_02_04_222005_create_receivables_table.php new file mode 100644 index 0000000..d672cd4 --- /dev/null +++ b/database/migrations/2026_02_04_222005_create_receivables_table.php @@ -0,0 +1,35 @@ +id(); + $table->unsignedBigInteger('tenant_id'); + $table->string('customer_name', 100); + $table->string('invoice_no', 50); + $table->date('issue_date'); + $table->date('due_date')->nullable(); + $table->string('category', 50)->default('서비스'); + $table->bigInteger('amount')->default(0); + $table->bigInteger('collected_amount')->default(0); + $table->string('status', 20)->default('outstanding'); // outstanding, partial, collected, overdue + $table->string('description', 255)->nullable(); + $table->text('memo')->nullable(); + $table->timestamps(); + $table->softDeletes(); + $table->index(['tenant_id', 'status']); + $table->index(['tenant_id', 'due_date']); + }); + } + + public function down(): void + { + Schema::dropIfExists('receivables'); + } +}; diff --git a/database/migrations/2026_02_04_222513_create_payables_table.php b/database/migrations/2026_02_04_222513_create_payables_table.php new file mode 100644 index 0000000..726f316 --- /dev/null +++ b/database/migrations/2026_02_04_222513_create_payables_table.php @@ -0,0 +1,35 @@ +id(); + $table->unsignedBigInteger('tenant_id'); + $table->string('vendor_name', 100); + $table->string('invoice_no', 50); + $table->date('issue_date'); + $table->date('due_date')->nullable(); + $table->string('category', 50)->default('사무용품'); + $table->bigInteger('amount')->default(0); + $table->bigInteger('paid_amount')->default(0); + $table->string('status', 20)->default('unpaid'); // unpaid, partial, paid, overdue + $table->string('description', 255)->nullable(); + $table->text('memo')->nullable(); + $table->timestamps(); + $table->softDeletes(); + $table->index(['tenant_id', 'status']); + $table->index(['tenant_id', 'due_date']); + }); + } + + public function down(): void + { + Schema::dropIfExists('payables'); + } +}; diff --git a/database/migrations/2026_02_04_223406_create_refunds_table.php b/database/migrations/2026_02_04_223406_create_refunds_table.php new file mode 100644 index 0000000..9c1466c --- /dev/null +++ b/database/migrations/2026_02_04_223406_create_refunds_table.php @@ -0,0 +1,35 @@ +id(); + $table->unsignedBigInteger('tenant_id'); + $table->string('type', 20)->default('refund'); // refund, cancel + $table->string('customer_name', 100); + $table->date('request_date'); + $table->string('product_name', 100); + $table->bigInteger('original_amount')->default(0); + $table->bigInteger('refund_amount')->default(0); + $table->string('reason', 100)->nullable(); + $table->string('status', 20)->default('pending'); // pending, approved, completed, rejected + $table->date('process_date')->nullable(); + $table->text('note')->nullable(); + $table->timestamps(); + $table->softDeletes(); + $table->index(['tenant_id', 'status']); + $table->index(['tenant_id', 'type']); + }); + } + + public function down(): void + { + Schema::dropIfExists('refunds'); + } +};