From 1f7f45ee608575cccbb92d7326fbde467a2fea55 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B6=8C=ED=98=81=EC=84=B1?= Date: Thu, 5 Mar 2026 11:01:01 +0900 Subject: [PATCH] =?UTF-8?q?feat:=20[process]=20=EA=B3=B5=EC=A0=95=EB=8B=A8?= =?UTF-8?q?=EA=B3=84=20options=20=EC=BB=AC=EB=9F=BC=20=EC=B6=94=EA=B0=80?= =?UTF-8?q?=20=E2=80=94=20=EA=B2=80=EC=82=AC=20=EC=84=A4=EC=A0=95/?= =?UTF-8?q?=EB=B2=94=EC=9C=84=20=EC=A7=80=EC=9B=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - ProcessStep 모델에 options JSON 컬럼 추가 (fillable, cast) - Store/UpdateProcessStepRequest에 inspection_setting, inspection_scope 검증 규칙 - process_steps 테이블 마이그레이션 Co-Authored-By: Claude Opus 4.6 --- .../ProcessStep/StoreProcessStepRequest.php | 12 ++++++++++ .../ProcessStep/UpdateProcessStepRequest.php | 12 ++++++++++ app/Models/ProcessStep.php | 2 ++ ...000_add_options_to_process_steps_table.php | 23 +++++++++++++++++++ 4 files changed, 49 insertions(+) create mode 100644 database/migrations/2026_03_04_100000_add_options_to_process_steps_table.php diff --git a/app/Http/Requests/V1/ProcessStep/StoreProcessStepRequest.php b/app/Http/Requests/V1/ProcessStep/StoreProcessStepRequest.php index 0c29e8d..a5671df 100644 --- a/app/Http/Requests/V1/ProcessStep/StoreProcessStepRequest.php +++ b/app/Http/Requests/V1/ProcessStep/StoreProcessStepRequest.php @@ -22,6 +22,12 @@ public function rules(): array 'connection_type' => ['nullable', 'string', 'max:20'], 'connection_target' => ['nullable', 'string', 'max:255'], 'completion_type' => ['nullable', 'string', 'in:click_complete,selection_complete,inspection_complete'], + 'options' => ['nullable', 'array'], + 'options.inspection_setting' => ['nullable', 'array'], + 'options.inspection_scope' => ['nullable', 'array'], + 'options.inspection_scope.type' => ['nullable', 'string', 'in:all,sampling,group'], + 'options.inspection_scope.sample_size' => ['nullable', 'integer', 'min:1'], + 'options.inspection_scope.sample_base' => ['nullable', 'string', 'in:order,lot'], ]; } @@ -36,6 +42,12 @@ public function attributes(): array 'connection_type' => '연결유형', 'connection_target' => '연결대상', 'completion_type' => '완료유형', + 'options' => '옵션', + 'options.inspection_setting' => '검사설정', + 'options.inspection_scope' => '검사범위', + 'options.inspection_scope.type' => '검사범위 유형', + 'options.inspection_scope.sample_size' => '샘플 크기', + 'options.inspection_scope.sample_base' => '샘플 기준', ]; } } diff --git a/app/Http/Requests/V1/ProcessStep/UpdateProcessStepRequest.php b/app/Http/Requests/V1/ProcessStep/UpdateProcessStepRequest.php index ac81f87..1ff34e3 100644 --- a/app/Http/Requests/V1/ProcessStep/UpdateProcessStepRequest.php +++ b/app/Http/Requests/V1/ProcessStep/UpdateProcessStepRequest.php @@ -22,6 +22,12 @@ public function rules(): array 'connection_type' => ['nullable', 'string', 'max:20'], 'connection_target' => ['nullable', 'string', 'max:255'], 'completion_type' => ['nullable', 'string', 'in:click_complete,selection_complete,inspection_complete'], + 'options' => ['nullable', 'array'], + 'options.inspection_setting' => ['nullable', 'array'], + 'options.inspection_scope' => ['nullable', 'array'], + 'options.inspection_scope.type' => ['nullable', 'string', 'in:all,sampling,group'], + 'options.inspection_scope.sample_size' => ['nullable', 'integer', 'min:1'], + 'options.inspection_scope.sample_base' => ['nullable', 'string', 'in:order,lot'], ]; } @@ -36,6 +42,12 @@ public function attributes(): array 'connection_type' => '연결유형', 'connection_target' => '연결대상', 'completion_type' => '완료유형', + 'options' => '옵션', + 'options.inspection_setting' => '검사설정', + 'options.inspection_scope' => '검사범위', + 'options.inspection_scope.type' => '검사범위 유형', + 'options.inspection_scope.sample_size' => '샘플 크기', + 'options.inspection_scope.sample_base' => '샘플 기준', ]; } } diff --git a/app/Models/ProcessStep.php b/app/Models/ProcessStep.php index 953fda9..ee1543f 100644 --- a/app/Models/ProcessStep.php +++ b/app/Models/ProcessStep.php @@ -22,6 +22,7 @@ class ProcessStep extends Model 'connection_type', 'connection_target', 'completion_type', + 'options', ]; protected $casts = [ @@ -30,6 +31,7 @@ class ProcessStep extends Model 'needs_inspection' => 'boolean', 'is_active' => 'boolean', 'sort_order' => 'integer', + 'options' => 'array', ]; /** diff --git a/database/migrations/2026_03_04_100000_add_options_to_process_steps_table.php b/database/migrations/2026_03_04_100000_add_options_to_process_steps_table.php new file mode 100644 index 0000000..55ad247 --- /dev/null +++ b/database/migrations/2026_03_04_100000_add_options_to_process_steps_table.php @@ -0,0 +1,23 @@ +json('options')->nullable()->after('completion_type') + ->comment('검사설정, 검사범위 등 추가 옵션 JSON'); + }); + } + + public function down(): void + { + Schema::table('process_steps', function (Blueprint $table) { + $table->dropColumn('options'); + }); + } +};