- 근무 설정 API (GET/PUT /settings/work)
- 근무유형, 소정근로시간, 연장근로시간, 근무요일, 출퇴근시간, 휴게시간
- 출퇴근 설정 API (GET/PUT /settings/attendance)
- GPS 출퇴근, 허용 반경, 본사 위치 설정
- 현장 관리 API (CRUD /sites)
- 현장 등록/수정/삭제, 활성화된 현장 목록(셀렉트박스용)
- GPS 좌표 기반 위치 관리
마이그레이션: work_settings, attendance_settings, sites 테이블
모델: WorkSetting, AttendanceSetting, Site (BelongsToTenant, SoftDeletes)
서비스: WorkSettingService, SiteService
Swagger 문서 및 i18n 메시지 키 추가
- leaves, leave_balances 테이블 마이그레이션 추가
- Leave, LeaveBalance 모델 구현 (BelongsToTenant, SoftDeletes)
- LeaveService 서비스 구현 (CRUD, 승인/반려/취소, 잔여일수 관리)
- LeaveController 및 FormRequest 5개 생성
- API 엔드포인트 11개 등록 (/v1/leaves/*)
- Swagger 문서 (LeaveApi.php) 작성
- i18n 메시지 키 추가 (message.leave.*, error.leave.*)
- Item 모델 files() 관계를 document_id/document_type 기반으로 변경
- show() 메서드에 files 로딩 및 field_key별 그룹화 추가
- item_type 파라미터 선택적 처리 (ID만으로 조회 가능)
- showWithPrice() 메서드 반환 타입 변경에 맞게 수정
- common_codes에 item_group 추가 및 item_type parent_id 연결
- /api/v1/items?type=RM → 단일 품목 유형 조회
- /api/v1/items?group_id=103 → 그룹 전체 품목 조회 (FG,PT,SM,RM,CS)
- ItemService에 getItemTypesByGroupId(), newQueryForTypes() 메서드 추가
- 에러 메시지 추가 (item_type_or_group_required, invalid_group_id)
- ItemsBomController: ProductBomService 제거, Item.bom JSON 기반으로 재구현
- ItemsFileController: Product/Material → Item 모델로 통합
- ItemPage: products/materials 클래스 매핑 제거
- ItemsService 삭제 (1,210줄) - ItemService로 대체 완료
BOM 기능 변경:
- 기존: ProductBomService (삭제됨)
- 변경: Item 모델의 bom JSON 필드 직접 조작
- 모든 BOM API 엔드포인트 정상 동작
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
- BOM child_item_id를 새 items 테이블 ID로 마이그레이션
- Item.loadBomChildren() 수정: setRelation()으로 모델에 설정
- ItemService.validateBom() 추가: 순환 참조 방지
- error.php에 self_reference_bom 메시지 추가
- ID 7 자기참조 BOM 데이터 수정 완료
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
- 동적 테이블 라우팅에서 item_type 필터 누락 버그 수정
- 모든 item_type이 동일한 결과를 반환하던 문제 해결
- CRUD 테스트 완료 (index/show/store/update/destroy)
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
- item_type → ItemPage.source_table → Model 클래스 동적 라우팅
- getModelInfoByItemType(): item_type으로 Model 정보 조회 (캐싱)
- newQuery(): 동적 Query Builder 생성
- 모든 CRUD 메서드 item_type 필수 파라미터로 변경
- ItemsController item_type 전달 로직 수정
- 에러 메시지 추가 (item_type_required, invalid_source_table)
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
## 주요 변경사항
- Phase 0: 비표준 item_type 데이터 정규화 마이그레이션
- Phase 1.1: items 테이블 생성 (products + materials 통합)
- Phase 1.2: item_details 테이블 생성 (1:1 확장 필드)
- Phase 1.3: 데이터 이관 + item_id_mappings 테이블 생성
- Phase 3: item_pages.source_table 업데이트
- Phase 5: 참조 테이블 마이그레이션 (product_components, orders 등)
## 신규 파일
- app/Models/Items/Item.php - 통합 아이템 모델
- app/Models/Items/ItemDetail.php - 1:1 확장 필드 모델
- app/Services/ItemService.php - 통합 서비스 클래스
## 수정 파일
- ItemPage.php - items 테이블 지원 추가
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- file_type: ENUM → VARCHAR(50) 변경 (확장성 개선)
- field_key: VARCHAR(100) 신규 컬럼 (비즈니스 용도 구분)
- ItemsFileController: field_key 사용, file_type 자동 분류 (detectFileType)
- File 모델: fillable에 field_key 추가
- ItemsService: getItemFiles()에서 field_key로 그룹핑
- rollback_items_migration: FK 제약조건 처리 수정
- GET /items/{id}/files 엔드포인트 추가 (파일 목록 조회)
- document_type을 group_id('1')로 변경 (테이블명 대신 코드 기반)
- field_key 제한 해제 (자유롭게 지정 가능)
- 품목 상세 조회 시 files 필드 포함 (field_key별 그룹핑)
- ItemFileUploadRequest FormRequest 추가
- DELETE 라우트 파라미터를 {fileId}로 변경
- GET /items/{id} 응답에 BOM 확장 데이터 포함
- child_item_code, child_item_name, unit, specification 필드 추가
- expandBomData() 메서드 구현 (ItemsService)
- Product 모델 bom 캐스팅 추가
- 품목 삭제 시 모든 참조 테이블 사용 여부 체크 (Force Delete)
- Product: BOM 구성품/상위품목, BOM 템플릿, 주문, 견적
- Material: BOM 구성품, BOM 템플릿, 입고, LOT
- 사용 중인 품목 삭제 불가, 미사용 품목만 영구 삭제
- 일괄 삭제도 동일 로직 적용
- DuplicateCodeException 예외 처리 추가
- ApiResponse.handle()에서 정상 처리되도록 수정
- Handler.php에도 fallback 처리 추가
- i18n 에러 메시지 추가 (in_use, batch_in_use)
- DuplicateCodeException 커스텀 예외 추가
- 등록/수정 시 자동 코드 증가 기능 제거
- 중복 발견 시 duplicate_id, duplicate_code 함께 반환
- resolveUniqueCode(), resolveUniqueMaterialCode() 메서드 제거
- 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 관계 추가
- ItemTypeHelper를 활용한 item_type(FG/PT/SM/RM/CS) → source_table 매핑
- getItem: item_type 파라미터로 products/materials 테이블 자동 결정
- deleteItem: item_type 필수 파라미터 추가
- batchDeleteItems: item_type별 일괄 삭제 지원
- 목록 조회 시 attributes 플랫 전개
- Swagger 문서 업데이트
- AttendanceController, AttendanceService 추가
- EmployeeController, EmployeeService 추가
- Attendance 모델 및 마이그레이션 추가
- TenantUserProfile에 employee_status 컬럼 추가
- DepartmentService 트리 조회 기능 개선
- Swagger 문서 추가 (AttendanceApi, EmployeeApi)
- API 라우트 등록
- SystemFields 상수 클래스 생성 (app/Constants/)
- source_table 기반 테이블별 예약어 관리
- products/materials 테이블 고정 컬럼 정의
- 공통 시스템 컬럼 포함
- ItemFieldService 수정
- validateFieldKeyUnique에 시스템 필드 검증 추가
- source_table 미지정시 그룹 전체 예약어 체크 (안전 모드)
- 에러 메시지 추가 (error.field_key_reserved)
- 작업 문서 추가 (docs/specs/item-master-field-key-validation.md)
- ItemField 모델: 소스 매핑 컬럼 추가 (source_table, source_column 등)
- ItemPage 모델: source_table 컬럼 추가
- ItemDataService: 동적 데이터 조회 서비스
- ItemMasterApi Swagger 업데이트
- ItemTypeSeeder: 품목 유형 시더
- 스펙 문서: ITEM_MASTER_FIELD_INTEGRATION_PLAN.md
- Price, PriceRevision 모델 추가 (PriceHistory 대체)
- PricingService: CRUD, 원가 조회, 확정 기능
- PricingController: statusCode 파라미터로 201 반환 지원
- NotFoundHttpException(404) 적용 (존재하지 않는 리소스)
- FormRequest 분리 (Store, Update, Index, Cost, ByItems)
- Swagger 문서 업데이트
- ApiResponse::handle()에 statusCode 옵션 추가
- prices/price_revisions 마이그레이션 및 데이터 이관
- 마이그레이션: is_active 컬럼 추가 (기본값 true)
- ItemField 모델: fillable, casts에 is_active 추가
- ItemFieldService: store, storeIndependent, clone, update 메서드에 is_active 처리
- FormRequest: is_active 유효성 검사 규칙 추가
- API Flow 테스트 시나리오 추가 (docs/api-flows/)
- docs/INDEX.md에 api-flows 섹션 추가
ModelTrait::scopeActive() 메서드 사용을 위한 필수 컬럼
- 거래처 유형(client_type), 연락처(mobile, fax), 담당자 정보 필드 추가
- 발주처 설정(account_id/password, payment_day) 필드 추가
- 약정 세금(tax_agreement, tax_amount, tax_start/end_date) 필드 추가
- 악성채권(bad_debt 관련 5개 필드) 정보 필드 추가
- Model, Service, FormRequest, Swagger 문서 업데이트
- 견적 API 계획에 문서 발송 API(email/fax/kakao) 요구사항 추가
- 삭제 전 product_components 테이블에서 사용 여부 확인
- BOM 구성품으로 사용 중인 품목 삭제 차단 (400 에러)
- 일괄 삭제에도 동일한 참조 체크 적용
- 품목 관련 에러 메시지 추가 (error.item.*)
- 품목 삭제 API 테스트 플로우 JSON 추가
- global_menus 테이블 분리를 위한 menus 컬럼 추가 (global_menu_id, is_customized)
- GlobalMenuController: 글로벌 메뉴 CRUD API
- GlobalMenuService: 글로벌 메뉴 비즈니스 로직
- MenuSyncService: 테넌트 메뉴 동기화 서비스
- MenuBootstrapService: 테넌트 초기 메뉴 생성 로직 개선
- MenuController: 메뉴 재동기화 엔드포인트 추가
- 중복 코드 자동 증가 기능 추가 (P-001 → P-002, ABC → ABC-001)
- soft delete 항목 조회 파라미터 추가 (include_deleted)
- ValidationException 응답 포맷 수정 (공통 에러 형식)
- batch delete 라우트 순서 수정 (/{id} 보다 /batch 먼저)
- is_active 기본값 true 설정
- BoardController, PostController 추가
- Board, BoardSetting 모델 수정
- BoardService 추가
- FormRequest 클래스 추가
- Swagger 문서 추가 (BoardApi, PostApi)
- 게시판 시스템 필드 마이그레이션 추가
- field_key: {ID}_{key} 형식으로 고유키 생성
- is_locked, locked_by, locked_at 잠금 컬럼 추가
- ItemFieldService: store/update/clone 로직 수정
- FormRequest: field_key 검증 규칙 추가
- Swagger 스키마 업데이트
- 섹션 복제 시 필드를 새로 CREATE하던 로직 제거
- 섹션 복제 시 BOM을 새로 CREATE하던 로직 제거
- 기존 필드/BOM ID로 EntityRelationship 링크만 생성
- 독립 엔티티 아키텍처 원칙 준수 (복제 = 자신만 복제 + 관계 링크만 복제)
- 불필요한 use 문 제거 (ItemField, ItemBomItem)
- EntityRelationship::link() 호출 파라미터 순서 수정 (3개 파일)
- ItemSectionService: tenantId를 첫 번째 파라미터로 변경
- ItemBomItemService: tenantId를 첫 번째 파라미터로 변경
- ItemFieldService: tenantId를 첫 번째 파라미터로 변경
- ItemSection 모델의 fields()/bomItems() 관계 메서드 문제 해결
- 쿼리빌더 반환으로 인한 addEagerConstraints() 에러 수정
- loadRelatedEntities() 메서드 신규 추가
- with()/load() 대신 setRelation()으로 데이터 설정
- 영향받은 서비스 파일 전체 수정
- ItemSectionService, SectionTemplateService, ItemMasterService
## 잠금 기능 (Lock Feature)
- entity_relationships 테이블에 is_locked, locked_by, locked_at 컬럼 추가
- EntityRelationship 모델에 잠금 관련 헬퍼 메서드 추가
- LockCheckTrait 생성 (destroy 시 잠금 체크 공통 로직)
- 각 Service의 destroy() 메서드에 잠금 체크 적용
- API 응답에 is_locked 필드 포함
- 한국어 에러 메시지 추가
## FK 레거시 코드 정리
- ItemMasterSeeder: entity_relationships 기반으로 전환
- ItemPage 모델: FK 기반 sections() 관계 제거
- ItemSectionService: clone() 메서드 FK 제거
- SectionTemplateService: page_id 컬럼 참조 제거
- EntityRelationship::link() 파라미터 순서 통일
## 기타
- Swagger 스키마에 is_locked 속성 추가
- 프론트엔드 가이드 문서 추가