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' => '검사완료 시 완료']); + } +};