## Tech Design Complete

**Date**: 2026-05-21
**Epic**: EPIC-004
**Generated By**: tech-design skill

### Artifacts Produced

- [x] TECH-DESIGN.md
- [x] IMPL-PLAN-API.md
- [x] IMPL-PLAN-WEB.md

### Key Decisions

| Decision | Rationale |
|----------|-----------|
| 2 columns (`assemblyQty`, `packagingQty`) thay vì `type` enum | 1 row/vật tư — dễ đọc và query hơn cho use case fixed 2-type |
| Unique `(structureId, materialId, isDeleted)` | Theo pattern chuẩn codebase (xem ProductStructure); cho phép recreate sau soft-delete |
| Check constraint enforced tại use case | MySQL 5.x không enforce CHECK constraint ở DB level |
| `Decimal(10,2)` cho qty | Đồng nhất với cách lưu quantity trong BOM component |
| Không transaction trong use cases | Mỗi operation chỉ write 1 table — không cần |

### Next Step

Run `/implement-feature EPIC-004 api` để implement api-kingston, sau đó `/implement-feature EPIC-004 web` cho web-kingston.
