From ba34fb09df5fb942e988b7f8e4e6f3686baa7b28 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B9=80=EB=B3=B4=EA=B3=A4?= Date: Thu, 5 Feb 2026 10:02:46 +0900 Subject: [PATCH 1/4] =?UTF-8?q?feat:=EC=B9=B4=EB=93=9C=20=EC=82=AC?= =?UTF-8?q?=EC=9A=A9=EB=82=B4=EC=97=AD=20=EA=B8=88=EC=95=A1=20=EC=88=98?= =?UTF-8?q?=EC=A0=95=20=EB=A7=88=EC=9D=B4=EA=B7=B8=EB=A0=88=EC=9D=B4?= =?UTF-8?q?=EC=85=98=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - modified_supply_amount, modified_tax 컬럼 추가 (사용자 수정 공급가액/부가세) - barobill_card_transaction_amount_logs 이력 테이블 생성 Co-Authored-By: Claude Opus 4.5 --- ...ds_to_barobill_card_transactions_table.php | 31 ++++++++++++++ ...ill_card_transaction_amount_logs_table.php | 40 +++++++++++++++++++ 2 files changed, 71 insertions(+) create mode 100644 database/migrations/2026_02_05_200000_add_modified_amount_fields_to_barobill_card_transactions_table.php create mode 100644 database/migrations/2026_02_05_200100_create_barobill_card_transaction_amount_logs_table.php diff --git a/database/migrations/2026_02_05_200000_add_modified_amount_fields_to_barobill_card_transactions_table.php b/database/migrations/2026_02_05_200000_add_modified_amount_fields_to_barobill_card_transactions_table.php new file mode 100644 index 0000000..5fc0793 --- /dev/null +++ b/database/migrations/2026_02_05_200000_add_modified_amount_fields_to_barobill_card_transactions_table.php @@ -0,0 +1,31 @@ +decimal('modified_supply_amount', 18, 2)->nullable()->after('tax') + ->comment('사용자 수정 공급가액 (null이면 원본값 사용)'); + $table->decimal('modified_tax', 18, 2)->nullable()->after('modified_supply_amount') + ->comment('사용자 수정 부가세 (null이면 원본값 사용)'); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::table('barobill_card_transactions', function (Blueprint $table) { + $table->dropColumn(['modified_supply_amount', 'modified_tax']); + }); + } +}; diff --git a/database/migrations/2026_02_05_200100_create_barobill_card_transaction_amount_logs_table.php b/database/migrations/2026_02_05_200100_create_barobill_card_transaction_amount_logs_table.php new file mode 100644 index 0000000..f5b05b7 --- /dev/null +++ b/database/migrations/2026_02_05_200100_create_barobill_card_transaction_amount_logs_table.php @@ -0,0 +1,40 @@ +id(); + $table->foreignId('card_transaction_id')->constrained('barobill_card_transactions')->onDelete('cascade') + ->comment('카드 거래 ID'); + $table->string('original_unique_key', 255)->comment('거래 고유키 (cardNum|useDt|approvalNum|amount)'); + $table->decimal('before_supply_amount', 18, 2)->comment('변경 전 공급가액'); + $table->decimal('before_tax', 18, 2)->comment('변경 전 부가세'); + $table->decimal('after_supply_amount', 18, 2)->comment('변경 후 공급가액'); + $table->decimal('after_tax', 18, 2)->comment('변경 후 부가세'); + $table->unsignedBigInteger('modified_by')->nullable()->comment('수정자 ID'); + $table->string('modified_by_name', 100)->nullable()->comment('수정자 이름'); + $table->string('ip_address', 45)->nullable()->comment('수정자 IP'); + $table->timestamp('created_at')->useCurrent()->comment('수정 시각'); + + $table->index('card_transaction_id', 'bb_amount_log_trans_idx'); + $table->index('original_unique_key', 'bb_amount_log_key_idx'); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::dropIfExists('barobill_card_transaction_amount_logs'); + } +}; From 98ab3dac9a8dbc390f1f574461b407e2ebbf156e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B9=80=EB=B3=B4=EA=B3=A4?= Date: Thu, 5 Feb 2026 10:49:53 +0900 Subject: [PATCH 2/4] =?UTF-8?q?fix:=EC=9D=B4=EB=A0=A5=20=ED=85=8C=EC=9D=B4?= =?UTF-8?q?=EB=B8=94=20=EC=99=B8=EB=9E=98=ED=82=A4=20=EC=9D=B4=EB=A6=84=20?= =?UTF-8?q?=EA=B8=B8=EC=9D=B4=20=EC=B4=88=EA=B3=BC=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - MySQL 64자 제한으로 자동생성 외래키명 실패 - foreignId()->constrained() → 수동 foreign() + 짧은 이름(bb_amount_log_trans_fk) Co-Authored-By: Claude Opus 4.5 --- ...00_create_barobill_card_transaction_amount_logs_table.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/database/migrations/2026_02_05_200100_create_barobill_card_transaction_amount_logs_table.php b/database/migrations/2026_02_05_200100_create_barobill_card_transaction_amount_logs_table.php index f5b05b7..5f3f710 100644 --- a/database/migrations/2026_02_05_200100_create_barobill_card_transaction_amount_logs_table.php +++ b/database/migrations/2026_02_05_200100_create_barobill_card_transaction_amount_logs_table.php @@ -13,8 +13,9 @@ public function up(): void { Schema::create('barobill_card_transaction_amount_logs', function (Blueprint $table) { $table->id(); - $table->foreignId('card_transaction_id')->constrained('barobill_card_transactions')->onDelete('cascade') - ->comment('카드 거래 ID'); + $table->unsignedBigInteger('card_transaction_id')->comment('카드 거래 ID'); + $table->foreign('card_transaction_id', 'bb_amount_log_trans_fk') + ->references('id')->on('barobill_card_transactions')->onDelete('cascade'); $table->string('original_unique_key', 255)->comment('거래 고유키 (cardNum|useDt|approvalNum|amount)'); $table->decimal('before_supply_amount', 18, 2)->comment('변경 전 공급가액'); $table->decimal('before_tax', 18, 2)->comment('변경 전 부가세'); From 49d68e3b3ef093dc8cde642b83ab5d8d50e9290f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B9=80=EB=B3=B4=EA=B3=A4?= Date: Thu, 5 Feb 2026 10:50:18 +0900 Subject: [PATCH 3/4] =?UTF-8?q?fix:=EC=9D=B4=EB=A0=A5=20=ED=85=8C=EC=9D=B4?= =?UTF-8?q?=EB=B8=94=20=EB=A7=88=EC=9D=B4=EA=B7=B8=EB=A0=88=EC=9D=B4?= =?UTF-8?q?=EC=85=98=20=EA=B8=B0=EC=A1=B4=20=ED=85=8C=EC=9D=B4=EB=B8=94=20?= =?UTF-8?q?=EC=B6=A9=EB=8F=8C=20=EB=B0=A9=EC=A7=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 이전 실행에서 테이블만 생성되고 FK 추가 실패한 상태 대응 - dropIfExists 추가하여 재실행 가능하도록 수정 Co-Authored-By: Claude Opus 4.5 --- ...200100_create_barobill_card_transaction_amount_logs_table.php | 1 + 1 file changed, 1 insertion(+) diff --git a/database/migrations/2026_02_05_200100_create_barobill_card_transaction_amount_logs_table.php b/database/migrations/2026_02_05_200100_create_barobill_card_transaction_amount_logs_table.php index 5f3f710..3ba303b 100644 --- a/database/migrations/2026_02_05_200100_create_barobill_card_transaction_amount_logs_table.php +++ b/database/migrations/2026_02_05_200100_create_barobill_card_transaction_amount_logs_table.php @@ -11,6 +11,7 @@ */ public function up(): void { + Schema::dropIfExists('barobill_card_transaction_amount_logs'); Schema::create('barobill_card_transaction_amount_logs', function (Blueprint $table) { $table->id(); $table->unsignedBigInteger('card_transaction_id')->comment('카드 거래 ID'); From bc4a41263a9f1e726a8a9c83f7988a1ea4543000 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B9=80=EB=B3=B4=EA=B3=A4?= Date: Thu, 5 Feb 2026 11:24:32 +0900 Subject: [PATCH 4/4] =?UTF-8?q?feat:=EC=B9=B4=EB=93=9C=20=EC=82=AC?= =?UTF-8?q?=EC=9A=A9=EB=82=B4=EC=97=AD=20=EC=88=98=EB=8F=99=EC=9E=85?= =?UTF-8?q?=EB=A0=A5=20is=5Fmanual=20=EC=BB=AC=EB=9F=BC=20=EB=A7=88?= =?UTF-8?q?=EC=9D=B4=EA=B7=B8=EB=A0=88=EC=9D=B4=EC=85=98=20=EC=B6=94?= =?UTF-8?q?=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude Opus 4.5 --- ...al_to_barobill_card_transactions_table.php | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 database/migrations/2026_02_05_300000_add_is_manual_to_barobill_card_transactions_table.php diff --git a/database/migrations/2026_02_05_300000_add_is_manual_to_barobill_card_transactions_table.php b/database/migrations/2026_02_05_300000_add_is_manual_to_barobill_card_transactions_table.php new file mode 100644 index 0000000..0bd6a8a --- /dev/null +++ b/database/migrations/2026_02_05_300000_add_is_manual_to_barobill_card_transactions_table.php @@ -0,0 +1,23 @@ +boolean('is_manual')->default(false)->after('modified_tax') + ->comment('수동 입력 여부 (true: 수동입력, false: 바로빌 API)'); + }); + } + + public function down(): void + { + Schema::table('barobill_card_transactions', function (Blueprint $table) { + $table->dropColumn('is_manual'); + }); + } +};