From a8ae5e177f295a809ce4d8d6a209c814316d5d89 Mon Sep 17 00:00:00 2001 From: kent Date: Wed, 14 Jan 2026 12:35:21 +0900 Subject: [PATCH] =?UTF-8?q?feat:=20quotes=20=ED=85=8C=EC=9D=B4=EB=B8=94?= =?UTF-8?q?=EC=97=90=20options=20JSON=20=EC=BB=AC=EB=9F=BC=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 - 견적요약, 공과상세, 품목 단가조정 데이터를 JSON으로 저장 - Quote 모델에 options 필드 추가 (fillable, casts) - 중요도가 낮은 필드는 개별 테이블 대신 JSON으로 관리 Co-Authored-By: Claude Opus 4.5 --- app/Models/Quote/Quote.php | 3 ++ ..._14_120218_add_options_to_quotes_table.php | 29 +++++++++++++++++++ 2 files changed, 32 insertions(+) create mode 100644 database/migrations/2026_01_14_120218_add_options_to_quotes_table.php diff --git a/app/Models/Quote/Quote.php b/app/Models/Quote/Quote.php index 66f274a..339ed4d 100644 --- a/app/Models/Quote/Quote.php +++ b/app/Models/Quote/Quote.php @@ -68,6 +68,8 @@ class Quote extends Model 'notes', // 자동산출 입력값 'calculation_inputs', + // 견적 옵션 (summary_items, expense_items, price_adjustments) + 'options', // 감사 'created_by', 'updated_by', @@ -81,6 +83,7 @@ class Quote extends Model 'finalized_at' => 'datetime', 'is_final' => 'boolean', 'calculation_inputs' => 'array', + 'options' => 'array', 'material_cost' => 'decimal:2', 'labor_cost' => 'decimal:2', 'install_cost' => 'decimal:2', diff --git a/database/migrations/2026_01_14_120218_add_options_to_quotes_table.php b/database/migrations/2026_01_14_120218_add_options_to_quotes_table.php new file mode 100644 index 0000000..b62771f --- /dev/null +++ b/database/migrations/2026_01_14_120218_add_options_to_quotes_table.php @@ -0,0 +1,29 @@ +json('options')->nullable()->after('calculation_inputs') + ->comment('견적 옵션 데이터 (summary_items, expense_items, price_adjustments)'); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::table('quotes', function (Blueprint $table) { + $table->dropColumn('options'); + }); + } +};