From f701e0636e02dcd5bde58c21e2d24b5c877fc767 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B6=8C=ED=98=81=EC=84=B1?= Date: Mon, 2 Feb 2026 16:29:39 +0900 Subject: [PATCH] =?UTF-8?q?feat:=EA=B2=80=EC=82=AC=EA=B8=B0=EC=A4=80?= =?UTF-8?q?=EC=84=9C=20=ED=83=AD=20=EA=B0=9C=EC=84=A0=20-=20tolerance,=20m?= =?UTF-8?q?easurement=5Ftype=20=EC=BB=AC=EB=9F=BC=20=EB=B0=8F=20inspection?= =?UTF-8?q?=5Fmethod=20=EA=B3=B5=ED=86=B5=EC=BD=94=EB=93=9C=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 - document_template_section_items에 tolerance(공차), measurement_type(측정유형) 컬럼 추가 - common_codes에 inspection_method 그룹 6개 코드 삽입 - DocumentTemplateSectionItem 모델 $fillable 업데이트 Co-Authored-By: Claude Opus 4.5 --- .../Documents/DocumentTemplateSectionItem.php | 2 + ..._and_measurement_type_to_section_items.php | 23 ++++++++++ ...002_add_inspection_method_common_codes.php | 44 +++++++++++++++++++ 3 files changed, 69 insertions(+) create mode 100644 database/migrations/2026_02_02_000001_add_tolerance_and_measurement_type_to_section_items.php create mode 100644 database/migrations/2026_02_02_000002_add_inspection_method_common_codes.php diff --git a/app/Models/Documents/DocumentTemplateSectionItem.php b/app/Models/Documents/DocumentTemplateSectionItem.php index b61fd5e..5690621 100644 --- a/app/Models/Documents/DocumentTemplateSectionItem.php +++ b/app/Models/Documents/DocumentTemplateSectionItem.php @@ -27,7 +27,9 @@ class DocumentTemplateSectionItem extends Model 'category', 'item', 'standard', + 'tolerance', 'method', + 'measurement_type', 'frequency', 'regulation', 'sort_order', diff --git a/database/migrations/2026_02_02_000001_add_tolerance_and_measurement_type_to_section_items.php b/database/migrations/2026_02_02_000001_add_tolerance_and_measurement_type_to_section_items.php new file mode 100644 index 0000000..94c4317 --- /dev/null +++ b/database/migrations/2026_02_02_000001_add_tolerance_and_measurement_type_to_section_items.php @@ -0,0 +1,23 @@ +string('tolerance', 100)->nullable()->after('standard')->comment('공차/허용범위'); + $table->string('measurement_type', 30)->nullable()->after('method')->comment('측정치 입력 유형: checkbox, numeric, single_value, substitute, text'); + }); + } + + public function down(): void + { + Schema::table('document_template_section_items', function (Blueprint $table) { + $table->dropColumn(['tolerance', 'measurement_type']); + }); + } +}; diff --git a/database/migrations/2026_02_02_000002_add_inspection_method_common_codes.php b/database/migrations/2026_02_02_000002_add_inspection_method_common_codes.php new file mode 100644 index 0000000..e036cfe --- /dev/null +++ b/database/migrations/2026_02_02_000002_add_inspection_method_common_codes.php @@ -0,0 +1,44 @@ + 'visual', 'name' => '육안검사', 'sort_order' => 1], + ['code' => 'check', 'name' => '체크검사', 'sort_order' => 2], + ['code' => 'mill_sheet', 'name' => '공급업체 밀시트', 'sort_order' => 3], + ['code' => 'certified_agency', 'name' => '공인시험기관', 'sort_order' => 4], + ['code' => 'substitute_cert', 'name' => '공급업체 성적서 대체', 'sort_order' => 5], + ['code' => 'other', 'name' => '기타', 'sort_order' => 6], + ]; + + foreach ($methods as $item) { + DB::table('common_codes')->updateOrInsert( + ['code_group' => 'inspection_method', 'code' => $item['code'], 'tenant_id' => null], + [ + 'code_group' => 'inspection_method', + 'code' => $item['code'], + 'name' => $item['name'], + 'sort_order' => $item['sort_order'], + 'is_active' => true, + 'created_at' => $now, + 'updated_at' => $now, + ] + ); + } + } + + public function down(): void + { + DB::table('common_codes') + ->where('code_group', 'inspection_method') + ->whereNull('tenant_id') + ->delete(); + } +};