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'); + }); + } +};