260322:1648 Correct Coresspondence / Doing RFA / Correct CI
This commit is contained in:
@@ -1,18 +1,22 @@
|
||||
# TASK-FE-017: Document Numbering Frontend Refactor
|
||||
|
||||
---
|
||||
|
||||
status: TODO
|
||||
priority: HIGH
|
||||
estimated_effort: 2-3 days
|
||||
dependencies:
|
||||
- specs/06-tasks/TASK-BE-017-document-numbering-refactor.md
|
||||
- specs/01-requirements/01-03.11-document-numbering.md (v1.6.2)
|
||||
- specs/03-implementation/03-04-document-numbering.md (v1.6.2)
|
||||
|
||||
- specs/06-tasks/TASK-BE-017-document-numbering-refactor.md
|
||||
- specs/01-requirements/01-03.11-document-numbering.md (v1.6.2)
|
||||
- specs/03-implementation/03-04-document-numbering.md (v1.6.2)
|
||||
|
||||
---
|
||||
|
||||
## Objective
|
||||
|
||||
Refactor Frontend Document Numbering ตาม specification v1.6.2:
|
||||
|
||||
- ป้องกัน User แก้ไขเลขที่เอกสาร
|
||||
- สร้าง Admin Dashboard ด้วย Metrics
|
||||
- Implement Admin Tools (Manual Override, Void/Replace)
|
||||
@@ -24,17 +28,21 @@ Refactor Frontend Document Numbering ตาม specification v1.6.2:
|
||||
### 1. User Mode Forms (Create/Edit)
|
||||
|
||||
#### 1.1 Correspondence Form
|
||||
|
||||
- [ ] **Create Mode**: แสดง "Auto Generated" หรือ Preview เลขที่เอกสาร
|
||||
- [ ] **Edit Mode**: ช่อง Document No เป็น **Read-Only** เสมอ
|
||||
- [ ] **API Integration**: ตัดการส่ง field `documentNumber` ไป Backend ใน Edit mode
|
||||
|
||||
#### 1.2 RFA Form
|
||||
|
||||
- [ ] Same as above - Read-Only document number
|
||||
|
||||
#### 1.3 Transmittal Form
|
||||
|
||||
- [ ] Same as above - Read-Only document number
|
||||
|
||||
**Files:**
|
||||
|
||||
- `frontend/components/correspondences/form.tsx`
|
||||
- `frontend/components/rfas/form.tsx`
|
||||
- `frontend/components/transmittals/form.tsx`
|
||||
@@ -44,6 +52,7 @@ Refactor Frontend Document Numbering ตาม specification v1.6.2:
|
||||
### 2. Admin Dashboard (`/admin/numbering`)
|
||||
|
||||
#### 2.1 Tab Structure
|
||||
|
||||
```
|
||||
/admin/numbering
|
||||
├── Templates (existing - keep as is)
|
||||
@@ -52,10 +61,12 @@ Refactor Frontend Document Numbering ตาม specification v1.6.2:
|
||||
```
|
||||
|
||||
#### 2.2 Templates Tab (Existing)
|
||||
|
||||
- [ ] Keep current functionality
|
||||
- [ ] เป็น Tab แรก (default)
|
||||
|
||||
#### 2.3 Metrics & Audit Tab (NEW)
|
||||
|
||||
- [ ] Fetch metrics from `GET /admin/document-numbering/metrics`
|
||||
- [ ] Display:
|
||||
- Sequence utilization gauge
|
||||
@@ -65,6 +76,7 @@ Refactor Frontend Document Numbering ตาม specification v1.6.2:
|
||||
- Audit logs table with filters
|
||||
|
||||
#### 2.4 Admin Tools Tab (NEW)
|
||||
|
||||
- [ ] **Manual Override Form**:
|
||||
- Input: document_type, document_number, reason
|
||||
- Calls `POST /admin/document-numbering/manual-override`
|
||||
@@ -83,6 +95,7 @@ Refactor Frontend Document Numbering ตาม specification v1.6.2:
|
||||
### 3. API Integration
|
||||
|
||||
#### 3.1 New API Endpoints
|
||||
|
||||
```typescript
|
||||
// services/document-numbering.service.ts (frontend)
|
||||
|
||||
@@ -110,6 +123,7 @@ getAuditLogs(params: AuditQueryParams): Promise<PaginatedAuditLogs>
|
||||
```
|
||||
|
||||
#### 3.2 DTOs
|
||||
|
||||
```typescript
|
||||
interface ManualOverrideDto {
|
||||
documentType: string;
|
||||
@@ -149,12 +163,14 @@ interface AuditQueryParams {
|
||||
### 5. UI/UX Requirements
|
||||
|
||||
#### 5.1 Document Number Display
|
||||
|
||||
- ใช้ Badge หรือ Chip style สำหรับ Document Number
|
||||
- สี: Info (blue) สำหรับ Auto-generated
|
||||
- สี: Warning (amber) สำหรับ Manual Override
|
||||
- สี: Destructive (red) สำหรับ Voided
|
||||
|
||||
#### 5.2 Admin Tools Access Control
|
||||
|
||||
- ซ่อน Admin Tools tab สำหรับ users ที่ไม่มี permission `system.manage_settings`
|
||||
- แสดง confirmation dialog ก่อน Manual Override / Void
|
||||
|
||||
|
||||
Reference in New Issue
Block a user