- Auditable 트레이트 신규 생성 (bootAuditable 패턴)
- creating: created_by/updated_by 자동 채우기
- updating: updated_by 자동 채우기
- deleting: deleted_by 채우기 + saveQuietly()
- created/updated/deleted: audit_logs 자동 기록
- 기존 AuditLogger 패턴과 동일한 try/catch 조용한 실패
- 변경된 필드만 before/after 기록 (updated 이벤트)
- auditExclude 프로퍼티로 모델별 제외 필드 설정 가능
- 제외 대상: Attendance, StockTransaction, TodayIssue 등 고빈도/시스템 모델
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
## 변경 사항
### 검사 시스템 통합
- 레거시 검사 모델 삭제 (MaterialInspection, MaterialInspectionItem, MaterialReceipt)
- 통합 검사 모델 추가 (Inspection.php) - IQC/PQC/FQC 지원
- 품목 입고 모델 추가 (ItemReceipt.php)
- PricingService에서 ItemReceipt 참조로 변경
### 출하 대시보드 수정
- ShipmentService stats() 프론트엔드 호환 필드 추가
- today_shipment_count, scheduled_count, shipping_count, urgent_count
### 마이그레이션
- inspections 테이블 생성 (IQC/PQC/FQC 통합)
- item_receipts로 테이블명 변경
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Order 모델: product_id 제거, item_id 추가, item() 관계 추가
- OrderItem 모델: product_id 제거, item_id 추가, item() 관계 추가
- Quote 모델: product_id 제거, item_id 추가, item() 관계 추가
- MaterialReceipt 모델: material_id 제거, item_id 추가, material() → item() 변경
- Lot 모델: Material import 제거, material() → item() 변경
DB 스키마는 이미 마이그레이션됨 (2025_12_13_153544)
기존 product_id/material_id 컬럼은 DB에 남아있지만 fillable에서 제거
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- products 테이블에 options JSON 컬럼 추가 (마이그레이션)
- Material/Product 모델에 options 필드 추가 (fillable, casts)
- SystemFields::PRODUCTS에 options 상수 추가
- MaterialService/ProductService에 동적 필드 자동 추출 로직:
- getKnownFields(): SystemFields + ItemField 기반 고정 필드 조회
- extractDynamicOptions(): 동적 필드 추출
- normalizeOptions(): [{label, value, unit}] 형태로 정규화
- material_code 중복 체크 시 soft delete 포함 (withTrashed)
- 사용 중인 자재 삭제 방지 (checkMaterialUsage)
- Material 모델에 category 관계 추가
- is_active 컬럼 추가 마이그레이션 (default 1)
- Product 모델 fillable 및 casts 업데이트
- Material 모델 fillable 및 casts 업데이트
- Material 모델에 material_type fillable 추가
- ModelTrait의 scopeActive() 메서드 지원
- Material 모델
- fillable 속성 추가 (모든 필드 명시)
- User 모델
- BelongsToMany 관계 타입 힌트 추가
- Product 모델
- fillable에 unit 필드 추가
- casts 순서 정리 (boolean 그룹화)
- ProductComponent 모델
- quantity 캐스트 정밀도 변경 (decimal:4 → decimal:6)
- referencedItem() 메서드 추가 (동적 관계 로드)
- product(), material() 관계 메서드 수정 (where 조건 추가)
- is_default 캐스트 제거 (컬럼 없음)
- Tenant 모델
- options 캐스트 추가 (array)
- scopeActive() 추가 (trial, active 상태 필터링)
- isActive(), isTrial() 헬퍼 메서드 추가
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>