Files
sam-docs/projects/api-integration/phase-1-table-migration/README.md

68 lines
1.6 KiB
Markdown
Raw Normal View History

# Phase 1: 테이블 통합
> **상태**: ✅ 완료 (2025-12-13 작업)
> **스킵 가능**: 이미 완료된 작업
---
## 개요
products/materials 테이블이 items 테이블로 통합 완료됨.
## 완료된 작업
### 테이블 통합
- [x] products + materials → items 단일 테이블
- [x] item_type으로 구분 (FG/PT/SM/RM/CS)
- [x] item_details 확장 테이블 (1:1)
### 마이그레이션
- [x] 2025_12_13_152507_create_items_table.php
- [x] 2025_12_11_220200_migrate_products_materials_to_items.php
- [x] BOM 데이터 마이그레이션
### 코드 통합
- [x] ItemsController
- [x] ItemService
- [x] ItemsBomController
- [x] Item, ItemDetail 모델
## Item Type 분류
| Type | 명칭 | 설명 |
|------|------|------|
| FG | Finished Goods | 완제품 |
| PT | Parts | 부품 |
| SM | Semi-finished Materials | 부자재 |
| RM | Raw Materials | 원자재 |
| CS | Consumables/Supplies | 소모품 |
## 그룹 분류
```php
PRODUCT_TYPES = ['FG', 'PT'] // 제품군
MATERIAL_TYPES = ['SM', 'RM', 'CS'] // 자재군
```
## API 엔드포인트
| Method | Path | 설명 |
|--------|------|------|
| GET | /items | 품목 목록 |
| POST | /items | 품목 생성 |
| GET | /items/{id} | 품목 상세 |
| PUT | /items/{id} | 품목 수정 |
| DELETE | /items/{id} | 품목 삭제 |
| GET | /items/{id}/bom | BOM 목록 |
| GET | /items/{id}/bom/tree | BOM 트리 |
## 참조 파일
- `api/app/Models/Items/Item.php`
- `api/app/Models/Items/ItemDetail.php`
- `api/app/Services/ItemService.php`
- `api/app/Http/Controllers/Api/V1/ItemsController.php`
---
*이 Phase는 스킵합니다. Phase 2로 진행하세요.*