feat(API): 검사 문서/성적서 연동 개선

- DocumentService: formatTemplateForReact 필드명 정합성 수정 (column_type, sub_labels, section title/image_path)
- WorkOrderService: process.options 로딩, 검사데이터 document_data 변환 로직 추가
- StoreItemInspectionRequest: templateValues 유효성 규칙 추가

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-02-11 15:58:39 +09:00
parent a3a4e18e8a
commit 51aad4e522
3 changed files with 62 additions and 11 deletions

View File

@@ -646,10 +646,8 @@ public function formatTemplateForReact(DocumentTemplate $template): array
'id' => $field->id,
'field_key' => $field->field_key,
'label' => $field->label,
'input_type' => $field->input_type,
'options' => $field->options,
'field_type' => $field->field_type,
'default_value' => $field->default_value,
'is_required' => $field->is_required,
'sort_order' => $field->sort_order,
])->toArray(),
'section_fields' => $template->sectionFields->map(fn ($field) => [
@@ -664,7 +662,9 @@ public function formatTemplateForReact(DocumentTemplate $template): array
])->toArray(),
'sections' => $template->sections->map(fn ($section) => [
'id' => $section->id,
'name' => $section->name,
'name' => $section->title,
'title' => $section->title,
'image_path' => $section->image_path,
'sort_order' => $section->sort_order,
'items' => $section->items->map(function ($item) use ($methodCodes) {
// method 코드를 한글 이름으로 변환
@@ -693,10 +693,10 @@ public function formatTemplateForReact(DocumentTemplate $template): array
'columns' => $template->columns->map(fn ($col) => [
'id' => $col->id,
'label' => $col->label,
'input_type' => $col->input_type,
'options' => $col->options,
'column_type' => $col->column_type,
'sub_labels' => $col->sub_labels,
'group_name' => $col->group_name,
'width' => $col->width,
'is_required' => $col->is_required,
'sort_order' => $col->sort_order,
])->toArray(),
];