From edbd95053cbee7fd544408c6448d2d9d41c393fd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B9=80=EB=B3=B4=EA=B3=A4?= Date: Fri, 6 Feb 2026 14:43:10 +0900 Subject: [PATCH] =?UTF-8?q?feat:=EA=B3=84=EC=A2=8C=20=EC=9E=85=EC=B6=9C?= =?UTF-8?q?=EA=B8=88=20=EB=B6=84=EA=B0=9C=20=ED=85=8C=EC=9D=B4=EB=B8=94=20?= =?UTF-8?q?=EB=A7=88=EC=9D=B4=EA=B7=B8=EB=A0=88=EC=9D=B4=EC=85=98=20?= =?UTF-8?q?=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - barobill_bank_transaction_splits 테이블 생성 - 계좌 입출금 거래를 여러 계정과목으로 분개하여 저장 Co-Authored-By: Claude Opus 4.6 --- ...barobill_bank_transaction_splits_table.php | 53 +++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 database/migrations/2026_02_06_200000_create_barobill_bank_transaction_splits_table.php diff --git a/database/migrations/2026_02_06_200000_create_barobill_bank_transaction_splits_table.php b/database/migrations/2026_02_06_200000_create_barobill_bank_transaction_splits_table.php new file mode 100644 index 0000000..d260ea5 --- /dev/null +++ b/database/migrations/2026_02_06_200000_create_barobill_bank_transaction_splits_table.php @@ -0,0 +1,53 @@ +id(); + $table->foreignId('tenant_id')->constrained()->onDelete('cascade'); + + // 원본 거래 고유키 (바로빌에서 가져온 원본 데이터 식별) + $table->string('original_unique_key', 200)->comment('원본 거래 고유키 (bankAccountNum|transDt|deposit|withdraw|balance)'); + + // 분개 정보 + $table->decimal('split_amount', 18, 2)->comment('분개 금액'); + $table->string('account_code', 50)->nullable()->comment('계정과목 코드'); + $table->string('account_name', 100)->nullable()->comment('계정과목명'); + $table->string('description', 255)->nullable()->comment('분개 내역'); + $table->string('memo', 255)->nullable()->comment('분개 메모'); + $table->integer('sort_order')->default(0)->comment('정렬 순서'); + + // 원본 거래 정보 (조회 편의를 위해 저장) + $table->string('bank_account_num', 50)->comment('계좌번호'); + $table->string('trans_dt', 20)->comment('거래일시 (YYYYMMDDHHMMSS)'); + $table->string('trans_date', 8)->comment('거래일 (YYYYMMDD)'); + $table->decimal('original_deposit', 18, 2)->default(0)->comment('원본 입금액'); + $table->decimal('original_withdraw', 18, 2)->default(0)->comment('원본 출금액'); + $table->string('summary', 255)->nullable()->comment('원본 적요'); + + $table->timestamps(); + + // 인덱스 + $table->index(['tenant_id', 'original_unique_key'], 'bb_bank_split_tenant_key_idx'); + $table->index(['tenant_id', 'trans_date'], 'bb_bank_split_tenant_date_idx'); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::dropIfExists('barobill_bank_transaction_splits'); + } +};