From fc4fad6e7515d42f5d62a8b7e29e684bbde754fc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B6=8C=ED=98=81=EC=84=B1?= Date: Fri, 13 Feb 2026 03:41:41 +0900 Subject: [PATCH] =?UTF-8?q?refactor:=EA=B3=B5=EC=A0=95=20=EB=8B=A8?= =?UTF-8?q?=EA=B3=84=20completion=5Ftype=20=ED=95=9C=EA=B8=80=E2=86=92?= =?UTF-8?q?=EC=98=81=EB=AC=B8=20=EC=BD=94=EB=93=9C=20=EC=A0=84=ED=99=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - completion_type 값을 한글(클릭 시 완료)에서 영문 코드(click_complete)로 변환 - FormRequest에 in 검증 규칙 추가 (click_complete, selection_complete, inspection_complete) - 기존 데이터 마이그레이션 포함 Co-Authored-By: Claude Opus 4.6 --- .../ProcessStep/StoreProcessStepRequest.php | 2 +- .../ProcessStep/UpdateProcessStepRequest.php | 2 +- ...2_140000_codify_completion_type_values.php | 43 +++++++++++++++++++ 3 files changed, 45 insertions(+), 2 deletions(-) create mode 100644 database/migrations/2026_02_12_140000_codify_completion_type_values.php diff --git a/app/Http/Requests/V1/ProcessStep/StoreProcessStepRequest.php b/app/Http/Requests/V1/ProcessStep/StoreProcessStepRequest.php index 543bf95..0c29e8d 100644 --- a/app/Http/Requests/V1/ProcessStep/StoreProcessStepRequest.php +++ b/app/Http/Requests/V1/ProcessStep/StoreProcessStepRequest.php @@ -21,7 +21,7 @@ public function rules(): array 'is_active' => ['nullable', 'boolean'], 'connection_type' => ['nullable', 'string', 'max:20'], 'connection_target' => ['nullable', 'string', 'max:255'], - 'completion_type' => ['nullable', 'string', 'max:30'], + 'completion_type' => ['nullable', 'string', 'in:click_complete,selection_complete,inspection_complete'], ]; } diff --git a/app/Http/Requests/V1/ProcessStep/UpdateProcessStepRequest.php b/app/Http/Requests/V1/ProcessStep/UpdateProcessStepRequest.php index 0fc3ca7..ac81f87 100644 --- a/app/Http/Requests/V1/ProcessStep/UpdateProcessStepRequest.php +++ b/app/Http/Requests/V1/ProcessStep/UpdateProcessStepRequest.php @@ -21,7 +21,7 @@ public function rules(): array 'is_active' => ['nullable', 'boolean'], 'connection_type' => ['nullable', 'string', 'max:20'], 'connection_target' => ['nullable', 'string', 'max:255'], - 'completion_type' => ['nullable', 'string', 'max:30'], + 'completion_type' => ['nullable', 'string', 'in:click_complete,selection_complete,inspection_complete'], ]; } diff --git a/database/migrations/2026_02_12_140000_codify_completion_type_values.php b/database/migrations/2026_02_12_140000_codify_completion_type_values.php new file mode 100644 index 0000000..cc2f84a --- /dev/null +++ b/database/migrations/2026_02_12_140000_codify_completion_type_values.php @@ -0,0 +1,43 @@ +where('completion_type', '클릭 시 완료') + ->update(['completion_type' => 'click_complete']); + + DB::table('process_steps') + ->where('completion_type', '선택 완료 시 완료') + ->update(['completion_type' => 'selection_complete']); + + DB::table('process_steps') + ->where('completion_type', '검사완료 시 완료') + ->update(['completion_type' => 'inspection_complete']); + } + + /** + * 영문 코드를 한글 값으로 롤백 + */ + public function down(): void + { + DB::table('process_steps') + ->where('completion_type', 'click_complete') + ->update(['completion_type' => '클릭 시 완료']); + + DB::table('process_steps') + ->where('completion_type', 'selection_complete') + ->update(['completion_type' => '선택 완료 시 완료']); + + DB::table('process_steps') + ->where('completion_type', 'inspection_complete') + ->update(['completion_type' => '검사완료 시 완료']); + } +};