13fa8cbf24
fix: script case nextholder id null
2026-02-12 11:53:24 +07:00
3c9e3a1bb6
fix: script org move draf to current save posMasterHistory
Build & Deploy on Dev / build (push) Successful in 1m57s
2026-02-12 10:38:16 +07:00
17760212d1
Merge branch 'feat/org-move-draf-current' into develop
...
Build & Deploy on Dev / build (push) Successful in 1m47s
* feat/org-move-draf-current:
fix time out
2026-02-11 13:11:10 +07:00
c5e600900c
fix time out
2026-02-11 13:10:42 +07:00
harid
5bee360280
add orgDnaId
Build & Deploy on Dev / build (push) Successful in 1m17s
2026-02-11 09:52:35 +07:00
harid
4f900ba4d2
no message
Build & Deploy on Dev / build (push) Successful in 1m20s
2026-02-11 09:47:45 +07:00
520b42f2c7
fix: script update profile
Build & Deploy on Dev / build (push) Successful in 1m10s
2026-02-10 17:43:01 +07:00
c344804936
Merge branch 'develop' into feat/org-move-draf-current
...
* develop:
Fix Script #2292
Fix Script #2292
comment ห้ามลบเจ้าหน้าที่ลำดับที่ 1 #2220
optimize sort #2260
2026-02-10 16:24:34 +07:00
3b97e52bd6
complete script move draf to current
2026-02-10 16:23:52 +07:00
harid
47f7f4d55e
optimize sort #2260
Build & Deploy on Dev / build (push) Successful in 52s
2026-02-09 17:50:53 +07:00
f9d626a499
add test, and fix script
2026-02-09 17:45:50 +07:00
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
3177ffc42f
merge
2026-02-06 21:46:41 +07:00
528f8f75c1
add query
2026-02-06 16:50:31 +07:00
256296672d
privilege
Build & Deploy on Dev / build (push) Successful in 48s
2026-02-06 15:25:54 +07:00
77b545d392
fix child privilege
Build & Deploy on Dev / build (push) Successful in 48s
2026-02-06 15:12:52 +07:00
8a649086f7
fix : #2239
Build & Deploy on Dev / build (push) Successful in 48s
2026-02-06 14:55:59 +07:00
631d634074
#2239
Build & Deploy on Dev / build (push) Successful in 49s
2026-02-05 13:37:28 +07:00
d0241016fb
disciption
Build & Deploy on Dev / build (push) Successful in 1m3s
2026-02-05 11:45:10 +07:00
561dc7f66c
change method
2026-02-05 11:43:59 +07:00
39a07482cd
add api find dna by keycloak
Build & Deploy on Dev / build (push) Successful in 1m0s
2026-02-05 11:23:38 +07:00
1a324af483
fix: api /super-admin/{id} memory cache
2026-01-28 18:26:03 +07:00
7c70229579
fix: query use Promise all
2026-01-28 17:48:28 +07:00
5dcb59632f
fix: Api GET /super-admin/{id}
2026-01-28 17:43:26 +07:00
bca25a7a52
feat: optimize detailSuperAdmin API to fix database connection issue
...
ปัญหา: API GET /api/v1/org/super-admin/{id} ทำให้ระบบดับเพราะ N+1 queries
- เดิม: >1,000,000 queries (100 orgRoots × 10 children × 10 counts/level)
- ใหม่: ~10 queries (query รวมครั้งเดียว + 5 org queries)
การเปลี่ยนแปลง:
1. สร้าง OrganizationController-optimized.ts
- getPositionCounts(): query posMaster ทั้งหมดครั้งเดียว
- สร้าง maps (orgRootMap, orgChild1Map, etc.) สำหรับ lookup
- ลด queries จาก 1,000,000+ → ~10 queries
2. เพิ่ม import สำหรับ helper functions ใน OrganizationController.ts
- import { getPositionCounts, getCounts, getRootCounts }
- ต้อง replace ฟังก์ชัน detailSuperAdmin ด้วย optimized version
- ดู OPTIMIZED_FUNCTION.ts สำหรับฟังก์ชันใหม่
ไฟล์ที่เพิ่ม:
- src/controllers/OrganizationController-optimized.ts (helper functions)
- OPTIMIZED_FUNCTION.ts (optimized function reference)
- src/utils/log-memory-store.ts (from earlier log middleware fix)
หมายเหตุ: ฟังก์ชัน detailSuperAdmin ใน OrganizationController.ts
ยังไม่ถูก replace (ต้องทำ manual) - ดู OPTIMIZED_FUNCTION.ts
Co-Authored-By: Claude (glm-4.7) <noreply@anthropic.com>
2026-01-28 13:45:52 +07:00
mamoss
32e682d05e
search dna
2026-01-02 21:43:57 +07:00
mamoss
3a4e16deb0
add permission brother
2025-12-12 01:36:51 +07:00
mamoss
f814454003
update permission
2025-12-07 13:51:01 +07:00
AdisakKanthawilang
39a1a3bbb0
#1767 ( #205 )
release / release (push) Failing after 9s
2025-11-03 11:56:26 +07:00
f32debfbb6
test commit
2025-11-03 10:48:04 +07:00
04484444ec
owner privilege
2025-10-22 11:59:49 +07:00
ad3a04ad3f
Merge branch 'develop' into adiDev
2025-10-22 11:35:46 +07:00
35011ea959
#1893
2025-10-22 11:34:56 +07:00
42c8f34f15
fix script: retire remove from org
2025-10-21 10:12:23 +07:00
e59ccf88b3
fix: script create keycloak
2025-10-21 00:11:18 +07:00
2429159020
fix: send token in keycloak function & change script fix retire
2025-10-20 23:04:04 +07:00
AdisakKanthawilang
45cc074e81
update validate privilege ( #201 )
2025-10-20 17:45:43 +07:00
0d059f24ea
update validate สิทธิ์จัดการโครงสร้างในเมนูโครงสร้างอัตตรากำลัง
2025-10-17 17:38:54 +07:00
5cdcc2a91e
update privilage validate (NORMAL) and update calRetireLaw
2025-10-17 16:05:42 +07:00
645f9760f0
update privilege validate (OWNER)
2025-10-17 13:51:43 +07:00
mamoss
58274b479c
สิทธิ์ดูโครงสร้าง
2025-10-16 00:33:48 +07:00
mamoss
fd17f366b8
add parent
2025-10-07 11:14:00 +07:00
abab998cd0
fix bug run delete keycloak
2025-10-03 22:18:32 +07:00
decb2433de
fix script run retire this year
2025-10-03 17:14:20 +07:00
aadcec440e
fix sort registry and add script update retire emp / position select
2025-10-03 17:04:05 +07:00
d8d376386d
fix
2025-10-01 16:37:23 +07:00
08af004d4a
fix script update retire of 2569
2025-10-01 13:01:54 +07:00
aff6958149
fix error script retire
2025-10-01 12:10:27 +07:00
a366e5ca0d
update scrip update retire
2025-10-01 11:33:00 +07:00
mamoss
7eae9d2c8d
ลบคนออกจากโครงสร้าง
2025-10-01 08:59:18 +07:00