rwadurian/backend/services/auth-service/src
hailin 9037c2da97 feat(auth): implement transactional idempotent CDC consumer for 1.0->2.0 sync
Implements 100% exactly-once semantics for CDC events from 1.0 identity-service
(user_accounts table) to auth-service.

Key changes:
- Add ProcessedCdcEvent model with (sourceTopic, offset) unique constraint
- Implement processWithIdempotency() using Serializable transaction isolation
- All database operations now use the transaction client
- Outbox event creation is also within the same transaction

This ensures that:
1. Each CDC event is processed exactly once
2. Idempotency record and business logic are in the same transaction
3. Outbox event publishing is atomic with data sync
4. Any failure causes complete rollback

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-12 19:29:42 -08:00
..
api feat(cdc): 添加 legacy 用户批量同步功能 2026-01-11 20:17:46 -08:00
application feat(sync): 完善 CDC 数据同步 - 添加推荐关系、认种记录和昵称字段 2026-01-12 02:48:15 -08:00
domain feat(sync): 完善 CDC 数据同步 - 添加推荐关系、认种记录和昵称字段 2026-01-12 02:48:15 -08:00
infrastructure feat(auth): implement transactional idempotent CDC consumer for 1.0->2.0 sync 2026-01-12 19:29:42 -08:00
shared feat(auth-service): 添加用户认证服务2.0 2026-01-10 18:50:59 -08:00
app.module.ts feat(auth-service): 添加用户认证服务2.0 2026-01-10 18:50:59 -08:00
main.ts feat(auth-service): 添加用户认证服务2.0 2026-01-10 18:50:59 -08:00