rwadurian/backend/services/reporting-service
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
..
docs refactor(mpc-system): migrate to party-driven architecture with PartyID-based routing 2025-12-05 08:11:28 -08:00
prisma fix(reporting-service): 添加活动记录幂等性处理 2026-01-08 05:46:43 -08:00
src fix(reporting): 修复 contract.signed 事件 BigInt(undefined) 错误 2026-02-15 07:59:16 -08:00
test refactor(mpc-system): migrate to party-driven architecture with PartyID-based routing 2025-12-05 08:11:28 -08:00
.dockerignore refactor(mpc-system): migrate to party-driven architecture with PartyID-based routing 2025-12-05 08:11:28 -08:00
.env.development refactor(mpc-system): migrate to party-driven architecture with PartyID-based routing 2025-12-05 08:11:28 -08:00
.env.example refactor(mpc-system): migrate to party-driven architecture with PartyID-based routing 2025-12-05 08:11:28 -08:00
.gitignore refactor(mpc-system): migrate to party-driven architecture with PartyID-based routing 2025-12-05 08:11:28 -08:00
DEVELOPMENT_GUIDE.md refactor: 多项UI优化和品牌更名 2025-12-15 01:43:47 -08:00
Dockerfile perf(docker): 优化Dockerfile构建,避免最后chown整个目录 2025-12-21 19:31:58 -08:00
Dockerfile.test refactor(mpc-system): migrate to party-driven architecture with PartyID-based routing 2025-12-05 08:11:28 -08:00
Makefile refactor(mpc-system): migrate to party-driven architecture with PartyID-based routing 2025-12-05 08:11:28 -08:00
deploy.sh fix: convert deploy.sh CRLF to LF and add executable permission 2025-12-07 07:01:13 -08:00
docker-compose.test.yml refactor(mpc-system): migrate to party-driven architecture with PartyID-based routing 2025-12-05 08:11:28 -08:00
nest-cli.json refactor(mpc-system): migrate to party-driven architecture with PartyID-based routing 2025-12-05 08:11:28 -08:00
package-lock.json feat(reporting): add system account report aggregation feature 2026-01-04 22:06:58 -08:00
package.json feat(reporting): add system account report aggregation feature 2026-01-04 22:06:58 -08:00
tsconfig.build.json refactor(mpc-system): migrate to party-driven architecture with PartyID-based routing 2025-12-05 08:11:28 -08:00
tsconfig.json refactor(mpc-system): migrate to party-driven architecture with PartyID-based routing 2025-12-05 08:11:28 -08:00