refactor:공정 단계 completion_type 한글→영문 코드 전환

- completion_type 값을 한글(클릭 시 완료)에서 영문 코드(click_complete)로 변환
- FormRequest에 in 검증 규칙 추가 (click_complete, selection_complete, inspection_complete)
- 기존 데이터 마이그레이션 포함

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-02-13 03:41:41 +09:00
parent e4c53c7b17
commit fc4fad6e75
3 changed files with 45 additions and 2 deletions

View File

@@ -21,7 +21,7 @@ public function rules(): array
'is_active' => ['nullable', 'boolean'], 'is_active' => ['nullable', 'boolean'],
'connection_type' => ['nullable', 'string', 'max:20'], 'connection_type' => ['nullable', 'string', 'max:20'],
'connection_target' => ['nullable', 'string', 'max:255'], 'connection_target' => ['nullable', 'string', 'max:255'],
'completion_type' => ['nullable', 'string', 'max:30'], 'completion_type' => ['nullable', 'string', 'in:click_complete,selection_complete,inspection_complete'],
]; ];
} }

View File

@@ -21,7 +21,7 @@ public function rules(): array
'is_active' => ['nullable', 'boolean'], 'is_active' => ['nullable', 'boolean'],
'connection_type' => ['nullable', 'string', 'max:20'], 'connection_type' => ['nullable', 'string', 'max:20'],
'connection_target' => ['nullable', 'string', 'max:255'], 'connection_target' => ['nullable', 'string', 'max:255'],
'completion_type' => ['nullable', 'string', 'max:30'], 'completion_type' => ['nullable', 'string', 'in:click_complete,selection_complete,inspection_complete'],
]; ];
} }

View File

@@ -0,0 +1,43 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Support\Facades\DB;
return new class extends Migration
{
/**
* completion_type 한글 값을 영문 코드로 변환
*/
public function up(): void
{
DB::table('process_steps')
->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' => '검사완료 시 완료']);
}
};