Files
sam-api/app/Http/Requests/V1/ProcessStep/UpdateProcessStepRequest.php
권혁성 e885b1ca45 feat(API): 중간검사 문서 템플릿 동적 연동 - process_steps ↔ document_templates 연결
- process_steps 테이블에 document_template_id FK 추가 (migration)
- ProcessStep 모델에 documentTemplate BelongsTo 관계 추가
- ProcessStepService에서 documentTemplate eager loading
- StoreProcessStepRequest/UpdateProcessStepRequest에 document_template_id 유효성 검증
- WorkOrderService에 getInspectionTemplate(), createInspectionDocument() 메서드 추가
- WorkOrderController에 inspection-template/inspection-document 엔드포인트 추가
- DocumentService.formatTemplateForReact() 접근자 public으로 변경
- i18n 메시지 키 추가 (inspection_document_created, no_inspection_template)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-10 08:35:57 +09:00

44 lines
1.4 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'],
'document_template_id' => ['nullable', 'integer', 'exists:document_templates,id'],
'is_active' => ['nullable', 'boolean'],
'connection_type' => ['nullable', 'string', 'max:20'],
'connection_target' => ['nullable', 'string', 'max:255'],
'completion_type' => ['nullable', 'string', 'max:30'],
];
}
public function attributes(): array
{
return [
'step_name' => '단계명',
'is_required' => '필수여부',
'needs_approval' => '승인필요여부',
'needs_inspection' => '검사필요여부',
'document_template_id' => '문서양식',
'is_active' => '사용여부',
'connection_type' => '연결유형',
'connection_target' => '연결대상',
'completion_type' => '완료유형',
];
}
}