feat: quotes 테이블에 options JSON 컬럼 추가

- 견적요약, 공과상세, 품목 단가조정 데이터를 JSON으로 저장
- Quote 모델에 options 필드 추가 (fillable, casts)
- 중요도가 낮은 필드는 개별 테이블 대신 JSON으로 관리

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
2026-01-14 12:35:21 +09:00
parent ced89740a3
commit a8ae5e177f
2 changed files with 32 additions and 0 deletions

View File

@@ -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',

View File

@@ -0,0 +1,29 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* Run the migrations.
*/
public function up(): void
{
Schema::table('quotes', function (Blueprint $table) {
$table->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');
});
}
};