Files
sam-api/app/Http/Requests/V1/ProcessStep/UpdateProcessStepRequest.php
권혁성 1f7f45ee60 feat: [process] 공정단계 options 컬럼 추가 — 검사 설정/범위 지원
- ProcessStep 모델에 options JSON 컬럼 추가 (fillable, cast)
- Store/UpdateProcessStepRequest에 inspection_setting, inspection_scope 검증 규칙
- process_steps 테이블 마이그레이션

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-05 11:01:01 +09:00

54 lines
2.1 KiB
PHP

<?php
namespace App\Http\Requests\V1\ProcessStep;
use Illuminate\Foundation\Http\FormRequest;
class UpdateProcessStepRequest extends FormRequest
{
public function authorize(): bool
{
return true;
}
public function rules(): array
{
return [
'step_name' => ['sometimes', 'required', 'string', 'max:100'],
'is_required' => ['nullable', 'boolean'],
'needs_approval' => ['nullable', 'boolean'],
'needs_inspection' => ['nullable', 'boolean'],
'is_active' => ['nullable', 'boolean'],
'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'],
];
}
public function attributes(): array
{
return [
'step_name' => '단계명',
'is_required' => '필수여부',
'needs_approval' => '승인필요여부',
'needs_inspection' => '검사필요여부',
'is_active' => '사용여부',
'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' => '샘플 기준',
];
}
}