73c1ea7a76
fix: correct studentId-as-userId bugs in 3 files
...
- dingtalk.service.ts syncOneUser: find Student by userId before mapping,
use Student.id (not User.id) as studentId FK
- sync.service.ts importDingTalkUsers: type coercion for studentId
(method deleted in Task 4, minimal compile fix)
- schedule-sync.service.ts getStatus: remove broken teacher mapping
query (teacher scheduling deprecated); hardcode mappedTeachers=0,
totalTeachers=0
2026-07-09 17:04:35 +08:00
86f126671c
fix: repair 5 sites where StudentDingMapping.studentId was misused as User FK
...
- dingtalk.service.ts syncOneUser: query studentRepo (not userRepo) by mapping.studentId
- sync.service.ts importDingTalkUsers: skip User role lookup for existing mappings
- attendance.service.ts autoMatchDingRecords: use studentId directly, remove second-hop query
- schedule-sync.service.ts syncAll: skip teacher mapping block (deprecated)
- rbac.service.ts getUnboundUsers: return [] (method deleted in Task 4)
2026-07-09 17:00:00 +08:00
ef1b46b9f4
refactor: replace UserDingMapping with StudentDingMapping entity
2026-07-09 16:53:25 +08:00
4592502876
feat(sync): add import request/result logging
2026-07-09 16:32:02 +08:00
64c8964ea4
fix(server): handle existing User from syncAll in importDingTalkUsers to avoid UNIQUE constraint error
2026-07-09 15:51:04 +08:00
eeacab6130
test(sync): add class-marking import test cases (7 new, 5 fixed)
2026-07-09 12:53:03 +08:00
0f3fec6b44
fix(sync): remove unused classStudentRepo injection, use transactional manager for class lookup
2026-07-09 12:37:49 +08:00
00de6cbd3a
feat(sync): importDingTalkUsers supports class creation and teacher/student linking
2026-07-09 12:33:10 +08:00
166066f49f
feat(sync): add ImportClassItemDto and expose deptIds in org-tree-with-users
2026-07-09 12:21:39 +08:00
454a0d24c6
fix: release beds/lockers in batchCheckOut
...
The batchCheckOut method was not releasing assigned beds and lockers
after checkout, leaving them orphaned as 'occupied'. Added the same
release pattern used in checkOut() — using runner.manager.update()
since batchCheckOut operates inside a QueryRunner transaction.
2026-07-09 12:05:36 +08:00
115ee5206e
Merge branch 'feat/dingtalk-sync-role-selection'
2026-07-09 11:33:07 +08:00
0cfdab95ee
fix: add DTO validation, transactional imports, role-not-found handling, null role guard
2026-07-09 11:28:11 +08:00
ff6cb03419
feat: add org-tree-with-users and import-users endpoints
2026-07-09 11:08:33 +08:00
8ba3327074
fix: handle duplicate usernames and failed role lookups in importDingTalkUsers
2026-07-09 11:07:25 +08:00
cd7f9c90b3
feat: add importDingTalkUsers and org-tree-with-users to SyncService
2026-07-09 11:05:17 +08:00
3835110204
feat: add importDingTalkUsers and org-tree-with-users to SyncService
2026-07-09 11:04:24 +08:00
731f74e51a
refactor: remove scheduled cron sync, manual trigger only
2026-07-09 10:24:12 +08:00
42d3f0e27f
feat: DingTalk attendance import + integration config + expense types + UI polish
...
Server:
- Add DingTalk attendance import service with SSE progress streaming
- Add IntegrationConfig entity & module for multi-tenant DingTalk setup
- Add ExpenseType entity & ExpenseTypesModule
- Add SeedModule for DB initialization
- Add UserDingMapping entity for DingTalk user linkage
- Attendance service: import flow with dedup & student auto-mapping
- Rooms service: time-range overlap queries
- Sync controller/service: DingTalk integration wiring
- Permission guard: refactor to pure re-export
- Campus scope middleware: tenant-aware filtering
Admin UI:
- Attendance page: import UI with progress & result summary
- All pages: tableStyle/tablePagination standardization
- Login page: responsive styling
- Sensitive data: useViewSensitive hook for masked viewing
- Vite config: path aliases, build optimization
- Test infra: vitest config, test utilities
Docs: PRD DingTalk batch 1 & 2 design docs
2026-07-09 09:11:56 +08:00
f1959f0d2a
fix: switch DingTalk attendance API from getcolumnval to listRecord
2026-07-08 14:49:22 +08:00
c81b0a0b5c
chore: commit remaining integration files, PM2 single instance, PRD doc
2026-07-06 16:04:53 +08:00
20f3b79179
feat: bills expense type filter (backend join + frontend Select), sync stub docs
2026-07-06 14:48:47 +08:00
a568da160c
feat(sync): implement sync stubs with env-var gating and status endpoint
2026-07-06 10:00:35 +08:00
09580e4a4e
feat: P2-15 cron-based DingTalk/WeCom sync with logging and incremental sync
...
- Add @nestjs/schedule dependency
- Create SyncLog entity (platform, syncType, status, recordsCount, errorMessage, timestamps)
- Create SyncState entity for tracking lastSyncAt per platform
- SyncService with @Cron('0 2 * * *') daily scheduled sync
- Incremental sync: tracks last_sync_at per platform, passes to integration APIs
- Full/incremental mode determined by existence of prior sync
- SyncController: POST /sync/trigger (manual), GET /sync/logs (history)
- Register SyncModule in AppModule with ScheduleModule
2026-07-05 20:48:43 +08:00