rwadurian/backend/services/reporting-service/src/infrastructure/kafka
hailin 875f86c263 fix(reporting): 修复 contract.signed 事件 BigInt(undefined) 错误
根因:planting-service 发送的 contract.signed 消息为嵌套结构
  { eventName: 'contract.signed', data: { orderNo, userId, ... } }
但 reporting-service handleContractSigned 按扁平结构解析
  message.userId → undefined → BigInt(undefined) → TypeError
导致 ~200 次/10分钟持续报错。

修复:
- 消息类型改为匹配实际嵌套格式 { eventName, data: { ... } }
- 解构 message.data 后再访问各字段
- 添加 userId 防御性检查,避免再次 BigInt 崩溃
- 与 referral-service ContractSigningHandler 消息结构保持一致

影响范围:仅 reporting-service 活动记录,不影响核心业务流程
(referral-service / reward-service 已正确处理嵌套格式)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-15 07:59:16 -08:00
..
activity-event-consumer.controller.ts fix(reporting): 修复 contract.signed 事件 BigInt(undefined) 错误 2026-02-15 07:59:16 -08:00
index.ts feat(reporting): 实现事件驱动的仪表板统计架构 2025-12-18 00:25:31 -08:00
kafka.module.ts feat(reporting): 实现事件驱动的仪表板统计架构 2025-12-18 00:25:31 -08:00