From b86397cbee8515e7d901fdafb63a2f593a6483a0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B6=8C=ED=98=81=EC=84=B1?= Date: Fri, 16 Jan 2026 19:35:11 +0900 Subject: [PATCH] =?UTF-8?q?feat:=20=EA=B2=AC=EC=A0=81=EC=84=9C=20=EC=98=B5?= =?UTF-8?q?=EC=85=98=EC=9A=A9=20=EA=B3=B5=ED=86=B5=EC=BD=94=EB=93=9C=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 - material_type: 제품 종류 (스크린, 슬랫, 벤딩, 조인트바) - painting_type: 도장 옵션 - motor_type: 모터 옵션 - controller_type: 제어기 옵션 - width_construction_cost: 가로시공비 옵션 - height_construction_cost: 세로시공비 옵션 Co-Authored-By: Claude --- ..._estimate_option_codes_to_common_codes.php | 81 +++++++++++++++++++ 1 file changed, 81 insertions(+) create mode 100644 database/migrations/2026_01_16_174948_add_estimate_option_codes_to_common_codes.php diff --git a/database/migrations/2026_01_16_174948_add_estimate_option_codes_to_common_codes.php b/database/migrations/2026_01_16_174948_add_estimate_option_codes_to_common_codes.php new file mode 100644 index 0000000..cb4c9bf --- /dev/null +++ b/database/migrations/2026_01_16_174948_add_estimate_option_codes_to_common_codes.php @@ -0,0 +1,81 @@ + 'material_type', 'code' => 'screen', 'name' => '스크린', 'sort_order' => 1], + ['code_group' => 'material_type', 'code' => 'slat', 'name' => '슬랫', 'sort_order' => 2], + ['code_group' => 'material_type', 'code' => 'bending', 'name' => '벤딩', 'sort_order' => 3], + ['code_group' => 'material_type', 'code' => 'jointbar', 'name' => '조인트바', 'sort_order' => 4], + + // 도장 옵션 (painting_type) + ['code_group' => 'painting_type', 'code' => '0', 'name' => '직접입력', 'sort_order' => 1, 'attributes' => json_encode(['price' => 0])], + ['code_group' => 'painting_type', 'code' => 'painting_a', 'name' => '도장A', 'sort_order' => 2, 'attributes' => json_encode(['price' => 50000])], + ['code_group' => 'painting_type', 'code' => 'painting_b', 'name' => '도장B', 'sort_order' => 3, 'attributes' => json_encode(['price' => 80000])], + + // 모터 옵션 (motor_type) + ['code_group' => 'motor_type', 'code' => 'motor_300k', 'name' => '모터 300,000', 'sort_order' => 1, 'attributes' => json_encode(['price' => 300000])], + ['code_group' => 'motor_type', 'code' => 'motor_500k', 'name' => '모터 500,000', 'sort_order' => 2, 'attributes' => json_encode(['price' => 500000])], + + // 제어기 옵션 (controller_type) + ['code_group' => 'controller_type', 'code' => 'ctrl_150k', 'name' => '제어기 150,000', 'sort_order' => 1, 'attributes' => json_encode(['price' => 150000])], + ['code_group' => 'controller_type', 'code' => 'ctrl_250k', 'name' => '제어기 250,000', 'sort_order' => 2, 'attributes' => json_encode(['price' => 250000])], + + // 가로시공비 옵션 (width_construction_cost) + ['code_group' => 'width_construction_cost', 'code' => 'w_3_4m', 'name' => '3.01~4.0M', 'sort_order' => 1, 'attributes' => json_encode(['price' => 300000])], + ['code_group' => 'width_construction_cost', 'code' => 'w_4_5m', 'name' => '4.01~5.0M', 'sort_order' => 2, 'attributes' => json_encode(['price' => 400000])], + ['code_group' => 'width_construction_cost', 'code' => 'w_5_6m', 'name' => '5.01~6.0M', 'sort_order' => 3, 'attributes' => json_encode(['price' => 500000])], + ['code_group' => 'width_construction_cost', 'code' => 'w_6_7m', 'name' => '6.01~7.0M', 'sort_order' => 4, 'attributes' => json_encode(['price' => 600000])], + + // 세로시공비 옵션 (height_construction_cost) + ['code_group' => 'height_construction_cost', 'code' => 'h_3_4m', 'name' => '3.51~4.5M', 'sort_order' => 1, 'attributes' => json_encode(['price' => 5000])], + ['code_group' => 'height_construction_cost', 'code' => 'h_4_5m', 'name' => '4.51~5.5M', 'sort_order' => 2, 'attributes' => json_encode(['price' => 8000])], + ['code_group' => 'height_construction_cost', 'code' => 'h_5_6m', 'name' => '5.51~6.5M', 'sort_order' => 3, 'attributes' => json_encode(['price' => 10000])], + ]; + + foreach ($codes as $code) { + DB::table('common_codes')->insert(array_merge($code, [ + 'tenant_id' => null, // 전역 코드 (모든 테넌트에서 사용) + 'is_active' => true, + 'created_at' => $now, + 'updated_at' => $now, + ])); + } + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + $codeGroups = [ + 'material_type', + 'painting_type', + 'motor_type', + 'controller_type', + 'width_construction_cost', + 'height_construction_cost', + ]; + + DB::table('common_codes') + ->whereIn('code_group', $codeGroups) + ->delete(); + } +}; \ No newline at end of file