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>
This commit is contained in:
2026-02-10 08:35:57 +09:00
parent 7adfc6d536
commit e885b1ca45
12 changed files with 232 additions and 3 deletions

View File

@@ -1,6 +1,6 @@
# 논리적 데이터베이스 관계 문서
> **자동 생성**: 2026-02-07 01:10:55
> **자동 생성**: 2026-02-09 22:02:49
> **소스**: Eloquent 모델 관계 분석
## 📊 모델별 관계 현황
@@ -594,6 +594,7 @@ ### process_steps
**모델**: `App\Models\ProcessStep`
- **process()**: belongsTo → `processes`
- **documentTemplate()**: belongsTo → `document_templates`
### work_orders
**모델**: `App\Models\Production\WorkOrder`
@@ -635,6 +636,7 @@ ### work_order_items
- **workOrder()**: belongsTo → `work_orders`
- **item()**: belongsTo → `items`
- **sourceOrderItem()**: belongsTo → `order_items`
### work_order_step_progress
**모델**: `App\Models\Production\WorkOrderStepProgress`
@@ -782,6 +784,11 @@ ### ai_token_usages
- **creator()**: belongsTo → `users`
### ai_voice_recordings
**모델**: `App\Models\Tenants\AiVoiceRecording`
- **user()**: belongsTo → `users`
### approvals
**모델**: `App\Models\Tenants\Approval`