Files
alla-allaos-fullstack/docs/implementation/technical-debt.md
phaichayon 357414c247 task-g
2026-06-16 10:57:41 +07:00

3.4 KiB

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 กลางของระบบ

หน้า 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

After Task F

Approval Permission Sync

Existing memberships may not automatically receive new approval permissions.

Future:

  • add permission sync script
  • admin UI for role/permission management

Approval Workflow Config UI

Approval workflow is seeded but not configurable from UI.

Future:

  • workflow setup screen
  • step editor
  • approver role mapping

Approval Notification

Approval workflow has no email/line notification yet.

Future:

  • notification queue
  • approval reminder

After Task G

Document Mapping Editor

Template mappings are seeded and readable, but not yet manageable from UI.

Future:

  • mapping CRUD UI
  • table column editor
  • publish/draft template workflow

pdfme Render Parity

Document preview is application-native, not pixel-perfect pdfme rendering.

Future:

  • server-side pdfme render pipeline
  • preview image generation
  • schema validation against live template versions

Approved PDF Persistence

Approved snapshot preparation exists, but no binary file generation or storage write-back yet.

Future:

  • approved PDF generator
  • storage abstraction
  • immutable approved artifact URL on quotation