feat(api,db-cn): persist synced source profile snapshot on mappings

Co-Authored-By: Claude Code <noreply@anthropic.com>
This commit is contained in:
浅念
2026-09-22 17:33:27 +08:00
parent ccf0c29659
commit f6ff1d44f2
6 changed files with 99 additions and 4 deletions
+1
View File
@@ -319,6 +319,7 @@ model external_user_mappings {
sourceSystem String @default("mock") @db.VarChar(32) // G4 后换真实源标识
externalUserId String @db.VarChar(64)
sourceVersion Int @default(0) // 幂等比较位:仅更高版本应用
profile Json? // 同步源档案快照(工号/邮箱/公司/头像)——纯展示,不参与同步决策(users 表零改动红线)
createdAt DateTime @default(now()) @db.DateTime(6)
@@unique([sourceSystem, externalUserId])