260222:1053 20260222 refactor specs/ #1 03-Data-and-Storage
All checks were successful
Build and Deploy / deploy (push) Successful in 1m0s
All checks were successful
Build and Deploy / deploy (push) Successful in 1m0s
This commit is contained in:
@@ -0,0 +1,100 @@
|
||||
# Drawing Module Frontend/Backend Implementation
|
||||
|
||||
**วันที่:** 25 ธันวาคม 2568 (2025-12-25)
|
||||
**Session:** Drawing Dashboard & Admin Panel UX/UI Implementation
|
||||
|
||||
---
|
||||
|
||||
## 🎯 วัตถุประสงค์
|
||||
|
||||
1. Update Backend entities และ Frontend types ตาม v1.7.0 schema (Drawing Revision)
|
||||
2. สร้าง Admin Panel สำหรับจัดการ Drawing Master Data
|
||||
3. สร้าง Backend APIs สำหรับ CRUD operations
|
||||
|
||||
---
|
||||
|
||||
## ✅ สิ่งที่ทำเสร็จ
|
||||
|
||||
### 1. Backend Entity Updates (Drawing Revision Schema)
|
||||
|
||||
| File | Changes |
|
||||
| ------------------------------------ | --------------------------------------------------------- |
|
||||
| `shop-drawing-revision.entity.ts` | เพิ่ม `isCurrent`, `createdBy`, `updatedBy`, User relations |
|
||||
| `asbuilt-drawing-revision.entity.ts` | เพิ่ม `isCurrent`, `createdBy`, `updatedBy`, User relations |
|
||||
|
||||
### 2. Frontend Type Updates
|
||||
|
||||
| File | Changes |
|
||||
| --------------------------- | ------------------------------------------------------------------------- |
|
||||
| `frontend/types/drawing.ts` | `DrawingRevision` - เพิ่ม `createdBy`, `updatedBy`, update `isCurrent` type |
|
||||
|
||||
### 3. Admin Panel Frontend (6 pages)
|
||||
|
||||
| Route | Description |
|
||||
| ----------------------------------------- | ------------------ |
|
||||
| `/admin/drawings` | Navigation hub |
|
||||
| `/admin/drawings/contract/volumes` | Volume CRUD |
|
||||
| `/admin/drawings/contract/categories` | Category CRUD |
|
||||
| `/admin/drawings/contract/sub-categories` | Sub-category CRUD |
|
||||
| `/admin/drawings/shop/main-categories` | Main Category CRUD |
|
||||
| `/admin/drawings/shop/sub-categories` | Sub-category CRUD |
|
||||
|
||||
**Service:** `frontend/lib/services/drawing-master-data.service.ts`
|
||||
|
||||
### 4. Backend APIs (Full CRUD)
|
||||
|
||||
**Controller:** `backend/src/modules/drawing/drawing-master-data.controller.ts`
|
||||
**Service:** `backend/src/modules/drawing/drawing-master-data.service.ts`
|
||||
|
||||
| Endpoint | Methods |
|
||||
| --------------------------------------------------- | ------------------------ |
|
||||
| `/api/drawings/master-data/contract/volumes` | GET, POST, PATCH, DELETE |
|
||||
| `/api/drawings/master-data/contract/categories` | GET, POST, PATCH, DELETE |
|
||||
| `/api/drawings/master-data/contract/sub-categories` | GET, POST, PATCH, DELETE |
|
||||
| `/api/drawings/master-data/shop/main-categories` | GET, POST, PATCH, DELETE |
|
||||
| `/api/drawings/master-data/shop/sub-categories` | GET, POST, PATCH, DELETE |
|
||||
|
||||
### 5. Admin Dashboard Update
|
||||
|
||||
เพิ่ม "Drawing Master Data" link ใน Admin Dashboard (`frontend/app/(admin)/admin/page.tsx`)
|
||||
|
||||
---
|
||||
|
||||
## 📁 ไฟล์ที่แก้ไข/สร้างใหม่
|
||||
|
||||
### Backend
|
||||
- `backend/src/modules/drawing/entities/shop-drawing-revision.entity.ts` - Modified
|
||||
- `backend/src/modules/drawing/entities/asbuilt-drawing-revision.entity.ts` - Modified
|
||||
- `backend/src/modules/drawing/drawing-master-data.controller.ts` - Rewritten
|
||||
- `backend/src/modules/drawing/drawing-master-data.service.ts` - Rewritten
|
||||
|
||||
### Frontend
|
||||
- `frontend/types/drawing.ts` - Modified
|
||||
- `frontend/lib/services/drawing-master-data.service.ts` - **NEW**
|
||||
- `frontend/app/(admin)/admin/drawings/page.tsx` - **NEW**
|
||||
- `frontend/app/(admin)/admin/drawings/contract/volumes/page.tsx` - **NEW**
|
||||
- `frontend/app/(admin)/admin/drawings/contract/categories/page.tsx` - **NEW**
|
||||
- `frontend/app/(admin)/admin/drawings/contract/sub-categories/page.tsx` - **NEW**
|
||||
- `frontend/app/(admin)/admin/drawings/shop/main-categories/page.tsx` - **NEW**
|
||||
- `frontend/app/(admin)/admin/drawings/shop/sub-categories/page.tsx` - **NEW**
|
||||
- `frontend/app/(admin)/admin/page.tsx` - Modified
|
||||
|
||||
### Specs
|
||||
- `specs/09-history/2025-12-25-drawing-revision-schema-update.md` - Updated (marked complete)
|
||||
|
||||
---
|
||||
|
||||
## 🔧 Build Status
|
||||
|
||||
| Component | Status |
|
||||
| --------- | -------- |
|
||||
| Backend | ✅ Passed |
|
||||
| Frontend | ✅ Passed |
|
||||
|
||||
---
|
||||
|
||||
## 📋 TODO (Phase 2+)
|
||||
|
||||
- [ ] Dashboard Drawing UX Enhancements (filters)
|
||||
- [ ] Contract Drawing: Category-SubCategory mapping UI
|
||||
- [ ] Shop Drawing: MainCategory-SubCategory linking
|
||||
Reference in New Issue
Block a user