From bedfb8af82ca130bd291e8a53ecb190c71871dce Mon Sep 17 00:00:00 2001 From: kent Date: Sun, 14 Dec 2025 01:30:09 +0900 Subject: [PATCH] =?UTF-8?q?docs:=20items=20=ED=85=8C=EC=9D=B4=EB=B8=94=20?= =?UTF-8?q?=ED=86=B5=ED=95=A9=20=ED=94=8C=EB=9E=9C=20=EC=99=84=EB=A3=8C=20?= =?UTF-8?q?=EC=83=81=ED=83=9C=20=EC=97=85=EB=8D=B0=EC=9D=B4=ED=8A=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 모든 Phase (0-6) 체크리스트 완료 표시 - 완료일 추가 (2025-12-13 ~ 2025-12-14) - Phase 5: 레거시 product_id/material_id 컬럼 삭제 항목 추가 - Phase 6: 미사용 ItemsService 삭제 항목 추가 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 --- plans/items-table-unification-plan.md | 94 +++++++++++++++------------ 1 file changed, 53 insertions(+), 41 deletions(-) diff --git a/plans/items-table-unification-plan.md b/plans/items-table-unification-plan.md index 244778b..6192834 100644 --- a/plans/items-table-unification-plan.md +++ b/plans/items-table-unification-plan.md @@ -1,5 +1,15 @@ # Items 테이블 통합 마이그레이션 계획 +> **✅ 완료** - 2025-12-14 +> +> 모든 Phase가 성공적으로 완료되었습니다. +> - products/materials 테이블 → items 테이블로 통합 +> - BOM은 JSON 컬럼 (`items.bom`)으로 관리 +> - 참조 테이블 (orders, order_items, quotes, material_receipts, lots) 모델 업데이트 완료 +> - 레거시 product_id/material_id 컬럼 삭제 완료 + +--- + ## 참조 문서 ### 필수 확인 @@ -116,9 +126,9 @@ DELETE FROM products WHERE product_type NOT IN ('FG', 'PT'); ### 0.3 체크리스트 -- [ ] products 비표준 타입 삭제 -- [ ] 관련 BOM 데이터 정리 -- [ ] 삭제 건수 확인 +- [x] products 비표준 타입 삭제 +- [x] 관련 BOM 데이터 정리 +- [x] 삭제 건수 확인 --- @@ -233,11 +243,11 @@ DB::statement(" ### 1.5 체크리스트 -- [ ] items 마이그레이션 생성 -- [ ] item_details 마이그레이션 생성 -- [ ] item_attributes 마이그레이션 생성 -- [ ] 데이터 이관 스크립트 실행 -- [ ] 건수 검증 (1,225건) +- [x] items 마이그레이션 생성 +- [x] item_details 마이그레이션 생성 +- [x] item_attributes 마이그레이션 생성 +- [x] 데이터 이관 스크립트 실행 +- [x] 건수 검증 (1,225건) --- @@ -305,11 +315,11 @@ class ItemService extends Service ### 2.3 체크리스트 -- [ ] Item 모델 생성 -- [ ] ItemDetail 모델 생성 -- [ ] ItemAttribute 모델 생성 -- [ ] ItemService 생성 -- [ ] ItemRequest 생성 +- [x] Item 모델 생성 +- [x] ItemDetail 모델 생성 +- [x] ItemAttribute 모델 생성 +- [x] ItemService 생성 +- [x] ItemRequest 생성 --- @@ -341,9 +351,9 @@ UPDATE item_pages SET source_table = 'items' WHERE source_table IN ('products', ### 3.3 체크리스트 -- [ ] ItemPage 모델 수정 (getTargetModelClass) -- [ ] item_pages.source_table 마이그레이션 -- [ ] ItemMasterService 연동 테스트 +- [x] ItemPage 모델 수정 (getTargetModelClass) +- [x] item_pages.source_table 마이그레이션 +- [x] ItemMasterService 연동 테스트 --- @@ -401,11 +411,11 @@ Route::prefix('items')->group(function () { ### 4.4 체크리스트 -- [ ] ItemController 생성 -- [ ] ItemIndexRequest, ItemStoreRequest 등 생성 -- [ ] 라우트 등록 -- [ ] Swagger 문서 작성 -- [ ] 기존 ProductController, MaterialController 제거 +- [x] ItemController 생성 +- [x] ItemIndexRequest, ItemStoreRequest 등 생성 +- [x] 라우트 등록 +- [x] Swagger 문서 작성 +- [x] 기존 ProductController, MaterialController 제거 --- @@ -426,9 +436,10 @@ Route::prefix('items')->group(function () { ### 5.2 체크리스트 -- [ ] 각 참조 테이블 마이그레이션 작성 -- [ ] 관련 모델 관계 업데이트 -- [ ] 데이터 검증 +- [x] 각 참조 테이블 마이그레이션 작성 +- [x] 관련 모델 관계 업데이트 (Order, OrderItem, Quote, MaterialReceipt, Lot) +- [x] 데이터 검증 +- [x] 레거시 product_id/material_id 컬럼 삭제 --- @@ -436,14 +447,15 @@ Route::prefix('items')->group(function () { ### 6.1 체크리스트 -- [ ] CRUD 테스트 (전체 item_type) -- [ ] BOM 계산 테스트 -- [ ] Item-Master 연동 테스트 -- [ ] 참조 무결성 테스트 -- [ ] products 테이블 삭제 -- [ ] materials 테이블 삭제 -- [ ] 기존 Product, Material 모델 삭제 -- [ ] 기존 ProductService, MaterialService 삭제 +- [x] CRUD 테스트 (전체 item_type) +- [x] BOM 계산 테스트 +- [x] Item-Master 연동 테스트 +- [x] 참조 무결성 테스트 +- [x] products 테이블 삭제 +- [x] materials 테이블 삭제 +- [x] 기존 Product, Material 모델 삭제 +- [x] 기존 ProductService, MaterialService 삭제 +- [x] 미사용 ItemsService 삭제 (1,210줄) --- @@ -551,15 +563,15 @@ $children = Item::whereIn('id', $childIds)->get()->keyBy('id'); ## 일정 -| Phase | 작업 | 상태 | -|-------|------|------| -| 0 | 데이터 정규화 (비표준 item_type/BOM 삭제) | ⬜ | -| 1 | items 테이블 생성 + 데이터 이관 | ⬜ | -| 2 | Item 모델 + Service 생성 | ⬜ | -| 3 | Item-Master 연동 수정 | ⬜ | -| 4 | API 통합 | ⬜ | -| 5 | 참조 테이블 마이그레이션 | ⬜ | -| 6 | 정리 | ⬜ | +| Phase | 작업 | 상태 | 완료일 | +|-------|------|------|--------| +| 0 | 데이터 정규화 (비표준 item_type/BOM 삭제) | ✅ | 2025-12-13 | +| 1 | items 테이블 생성 + 데이터 이관 | ✅ | 2025-12-13 | +| 2 | Item 모델 + Service 생성 | ✅ | 2025-12-13 | +| 3 | Item-Master 연동 수정 | ✅ | 2025-12-13 | +| 4 | API 통합 | ✅ | 2025-12-13 | +| 5 | 참조 테이블 마이그레이션 | ✅ | 2025-12-14 | +| 6 | 정리 | ✅ | 2025-12-14 | ---