Files
alla-allaos-fullstack/docs/implementation/technical-debt.md
phaichayon b8f13e36b3 task-e
2026-06-16 08:43:19 +07:00

143 lines
2.3 KiB
Markdown

# Technical Debt
## After Task D
### 1. Database FK
Customer / Contact / Enquiry ยัง enforce relationship ด้วย application logic
Future:
* เพิ่ม FK หลัง schema stable
### 2. Date Input
Form ยังใช้ text input แบบ YYYY-MM-DD
Future:
* เปลี่ยนเป็น Date Picker กลางของระบบ
### 3. Customer Related Enquiries Pagination
หน้า customer detail แสดง related enquiries แล้ว แต่ยังไม่มี pagination
Future:
* เพิ่มเมื่อข้อมูลเริ่มเยอะ
### 4. Follow-up Activity
Activity timeline ยังพึ่ง audit payload
Future:
* ทำ combined activity view/service
---
## After Task E
### 5. Mixed Tax Rollup
Quotation item รองรับ taxRate ต่อรายการแล้ว
Current:
* quotation summary ยังใช้ header tax calculation
Future:
* รองรับ mixed tax per line
* aggregate tax จาก item จริง
Priority:
* Medium
### 6. Attachment Storage
Attachment ยังเป็น metadata-only
Current:
* เก็บเฉพาะ metadata
Future:
* storage provider abstraction
* upload service
* download endpoint
* permission check
Priority:
* High
### 7. Revision Snapshot
Revision copy:
* header
* items
* customers
* topics
Current:
* ไม่ copy follow-ups
* ไม่ copy attachments
Future:
* กำหนด revision snapshot strategy ให้ชัดเจน
Priority:
* Medium
### 8. CRM Foreign Keys
Customer
Contact
Enquiry
Quotation
Current:
* ใช้ organization validation ใน application layer
Future:
* เพิ่ม FK เมื่อ schema stable
* review cascade strategy
Priority:
* High
### 9. Approval Workflow Pending
Quotation stabilization in Task E.1 only prepares:
* approval-ready statuses
* revision guard
* placeholder submit-for-approval action
Current:
* no approval table
* no approval requester/approver history
* no multi-step approval rule
* no approval notification
Future:
* introduce approval aggregate in Task F
* separate workflow state from quotation commercial state where needed
* define approver resolution by branch / amount / role
Priority:
* High