rwadurian/backend/services/wallet-service/src/application/event-handlers
hailin bc38ec6ec0 feat(wallet-service): 三层保护机制确保内部转账接收方钱包存在
新增三层保护机制:
1. 用户注册时:监听 identity.UserAccountCreated 事件自动创建钱包
2. 发起转账时:检测内部转账后调用 ensureWalletExists() 预创建钱包
3. 链上确认时:原有 upsert 逻辑兜底(保持不变)

新增文件:
- identity-event-consumer.service.ts: 消费 identity 用户注册事件
- user-account-created.handler.ts: 处理用户注册事件创建钱包

新增 API:
- POST /wallets/ensure-wallet: 确保单个钱包存在
- POST /wallets/ensure-wallets: 批量确保钱包存在

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-08 07:33:47 -08:00
..
deposit-confirmed.handler.ts feat(blockchain): implement Outbox Pattern for reliable event delivery 2025-12-09 21:47:31 -08:00
index.ts feat(wallet-service): 三层保护机制确保内部转账接收方钱包存在 2026-01-08 07:33:47 -08:00
planting-created.handler.ts feat: 已认种用户分享权益直接进入可结算状态 2025-12-22 21:10:49 -08:00
system-withdrawal-status.handler.ts feat(wallet/blockchain/identity): implement system account withdrawal feature 2026-01-06 10:22:15 -08:00
user-account-created.handler.ts feat(wallet-service): 三层保护机制确保内部转账接收方钱包存在 2026-01-08 07:33:47 -08:00
withdrawal-status.handler.ts feat(wallet/blockchain): 热钱包余额预检查及接收方钱包自动创建 2026-01-05 04:31:52 -08:00