hrms-api-org/src/interfaces
waruneeauy 638362df1c feat: improve move-draft-to-current with differential sync
Implement differential sync for organization structure and positions
instead of delete-all-and-insert-all approach.

Changes:
- Add OrgIdMapping and AllOrgMappings interfaces for tracking ID mappings
- Implement syncOrgLevel() helper for differential sync per org level
- Add syncPositionsForPosMaster() helper for position table sync
- Process org levels bottom-up (Child4→Child3→Child2→Child1→Root)
- Use ancestorDNA matching with Like operator for descendant sync
- Cascade delete positions before deleting org nodes
- Batch DELETE/UPDATE/INSERT operations for better performance
- Track draft→current ID mappings for position updates
- Add comprehensive documentation in docs/move-draft-to-current.md

Benefits:
- Preserve IDs for unchanged nodes (better tracking)
- More efficient (fewer database operations)
- Better data integrity with proper FK handling
- Sync all descendants under given rootDnaId

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-09 12:35:59 +07:00
..
api-type.ts fix api service v2 to v1 & fix type & review code 2025-08-14 11:17:13 +07:00
call-api.ts fix:delete profileAvatar 2026-01-30 14:47:46 +07:00
date-serializer.ts update timezone 2025-10-22 23:20:18 +07:00
extension.ts API ตรวจสอบเช็คเลขบัตรประจำตัวประชาชน ทำไว้ให้ service อื่นๆ ภายในระบบ call มาตรวจสอบเลขบัตรประจำตัวประชาชน 2025-12-17 12:37:05 +07:00
functionMain.ts ปรับออกคำสั่งลงตำแหน่ง 2025-02-21 19:10:27 +07:00
http-error.ts fist commit 2024-01-24 11:39:00 +07:00
http-status.ts fist commit 2024-01-24 11:39:00 +07:00
http-success.ts checkpoint 2024-01-25 10:13:36 +07:00
OrgMapping.ts feat: improve move-draft-to-current with differential sync 2026-02-09 12:35:59 +07:00
permission.ts fix: #2239 2026-02-06 14:55:59 +07:00
utils.ts fix: #2239 2026-02-06 14:55:59 +07:00