- 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>
- needs_work_log 개별 컬럼 → options JSON 구조로 전환
- StoreProcessRequest, UpdateProcessRequest 유효성 규칙 갱신
- Process 모델 $fillable, $casts 갱신
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Process 모델에 document_template_id, needs_work_log, work_log_template_id 추가
- ProcessStep에서 해당 필드 제거
- WorkOrderService의 검사 관련 3개 메서드(getInspectionTemplate, resolveInspectionDocument, createInspectionDocument) 공정 레벨 참조로 변경
- ProcessService eager loading에 documentTemplate, workLogTemplateRelation 추가
- FormRequest 검증 규칙 이동 (ProcessStep → Process)
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- 원본 거래 추적용 source_type(bank_transaction, hometax_invoice, manual) 컬럼 추가
- 원본 거래 고유키 source_key 컬럼 추가
- tenant_id + source_type + source_key 복합 인덱스 추가
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- getInspectionTemplate: 전체 검사 단계 templates[] 반환 (기존 첫번째만→다중)
- resolveInspectionDocument 신규: step_id 기반 기존 문서 조회 또는 템플릿 반환
- createInspectionDocument 개선: step_id 파라미터, 기존 DRAFT/REJECTED 문서 update 지원
- GET inspection-resolve 라우트 추가
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- 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>
- OrderNode 모델 관계 추가 (parent, order, children, items)
- Order.nodes/rootNodes, OrderItem.node 관계 추가
- WorkOrder.stepProgress, WorkOrderStepProgress 관계 추가
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- 삭제 불가 상태 추가 (생산중/생산완료/출하중/출하완료)
- 작업지시/출하 존재 시 삭제 차단 + 에러 메시지
- order_item_components → order_items → order_nodes → order 순차 soft delete
- DB 트랜잭션으로 원자성 보장
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- TriggerAuditLogApi.php Swagger 파일 생성 (6개 엔드포인트 문서화)
- 목록 조회, 통계, 상세, 레코드 이력, 롤백 미리보기, 롤백 실행
- api_request_logs를 트리거 제외 테이블 목록에 추가
- Pint 포매팅 적용
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
동일 자재가 여러 작업지시 품목에 걸쳐 있을 때 StockLot이 중복 표시되던 문제 수정.
Phase 1(유니크 자재 수집) → Phase 2(로트 조회) 구조로 변경하여 중복 제거 및 필요수량 합산.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- ai_pricing_configs 테이블 마이그레이션 생성 (기본 시드 데이터 포함)
- AiPricingConfig 모델 추가 (캐시 적용 단가/환율 조회)
- AiReportService 하드코딩 단가를 DB 조회로 변경
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- POST /work-orders/{id}/items/{itemId}/inspection: 품목별 검사 데이터 저장
- GET /work-orders/{id}/inspection-data: 전체 품목 검사 데이터 조회
- GET /work-orders/{id}/inspection-report: 검사 성적서용 데이터 조회
- WorkOrderItem 모델에 getInspectionData/setInspectionData 헬퍼 추가
- StoreItemInspectionRequest FormRequest 생성
- work_order_items.options['inspection_data']에 검사 결과 저장
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- ai_token_usages 테이블 마이그레이션 생성
- AiTokenUsage 모델 생성
- AiReportService에 usageMetadata 추출 및 저장 로직 추가
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- numbering_rules 테이블: JSON 패턴 기반 채번 규칙 저장 (tenant별)
- numbering_sequences 테이블: MySQL UPSERT 기반 atomic 시퀀스 관리
- NumberingService: generate/preview/nextSequence 핵심 서비스
- QuoteNumberService: NumberingService 우선, 폴백 QT{YYYYMMDD}{NNNN}
- OrderService: NumberingService 우선 (pair_code 지원), 폴백 ORD{YYYYMMDD}{NNNN}
- StoreOrderRequest: pair_code 필드 추가
- NumberingRuleSeeder: tenant_id=287 견적(KD-PR)/수주(KD-{pairCode}) 규칙
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- getMaterials(): 품목당 1행 → StockLot(입고 로트)당 1행으로 변경
- ITEM-{id} 가짜 로트번호 → Receiving에서 생성된 실제 lot_no 반환
- registerMaterialInput(): material_ids → stock_lot_id+qty 로트별 수량 차감
- StockService::decreaseFromLot() 신규 추가 (특정 로트 지정 차감)
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- QuoteService::show() - order_id가 null인 경우 Order.quote_id 역방향 탐색으로 연결된 수주 자동 보정
- QuoteService::update() - 역방향 참조 포함하여 syncFromQuote() 동기화 트리거 확장
- 수주에서 견적 수정 시 기존 수주에 자동 반영 + "수주 보기" 버튼 정상 표시
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- 견적확정 시 업체명/현장명/담당자/연락처 필수 검증 추가 (QuoteService)
- 작업지시 stats API에 by_process 공정별 카운트 반환 추가
- 작업지시 목록/상세 쿼리에 수주 개소(rootNodes) 연관 로딩
- 작업지시 품목에 sourceOrderItem.node 관계 추가
- 입고관리 완료건 수정 허용 및 재고 차이 조정
- work_order_step_progress 테이블 마이그레이션
- receivings 테이블 options 컬럼 추가
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- interview_categories, interview_templates, interview_questions 테이블 생성
- interview_sessions, interview_answers 테이블 생성
- InterviewCategory, InterviewTemplate, InterviewQuestion 모델 추가
- InterviewSession, InterviewAnswer 모델 추가
- 멀티테넌트(tenant_id) 지원, 감사 로깅(Auditable) 적용
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- convertToOrder: calculation_inputs.items[]로 OrderNode(location) 생성, order_items에 order_node_id 연결
- resolveLocationIndex() 헬퍼 추가 (formula_source/note 기반 개소 인덱스 매칭)
- syncFromQuote: 기존 nodes 삭제 후 재생성, 아이템 node 연결 동기화
- show(): rootNodes + withRecursiveChildren eager loading 추가
- createFromQuoteItem: order_node_id 매핑 추가
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- items:normalize-dimensions 커맨드 신규 생성
- 101_specification_1/2/3에서 thickness/width/length 자동 추출
- --dry-run(미리보기) / --execute(실행) 모드 지원
- 기존 값이 있는 경우 안전하게 스킵
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- barobill_bank_transaction_overrides 테이블 생성
- tenant_id + unique_key 복합 유니크 인덱스
- modified_summary, modified_cast 필드로 수정값 저장
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- OrderService: 생산지시 생성 로직 개선
- order_items.item_id → process_items 테이블에서 공정 자동 조회
- 공정별로 아이템 그룹화 (미지정 아이템은 별도 그룹)
- 각 공정별 작업지시 생성
- work_order_items에 해당 공정의 아이템들 자동 추가
- WorkOrderService: 목록 조회 시 관계 추가
- items 관계 추가 (틀수 계산용)
- process.department 필드 추가 (부서 표시용)
Co-Authored-By: Claude <noreply@anthropic.com>
- KyungdongFormulaHandler: 수식 계산 로직 리팩토링 및 확장
- OrderService: 수주 전환 시 BOM 품목 매핑 로직 추가
- QuoteService: 견적 상태 처리 개선
- FormulaEvaluatorService: 디버그 로깅 추가
- Quote 모델: 캐스팅 타입 수정
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- has_inspection_template 필드 추가 (수입검사 양식 연결 여부)
- getItemsWithInspectionTemplate() 헬퍼 메서드 추가
- name 필드에 코드 합치기 제거 (중복 표시 해결)
- exclude_process_id 파라미터 추가 (공정별 품목 선택 시 중복 방지)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>