topfans/backend/services
zerosaturation 3407e30395 refactor(assetService): CreateMintOrder 3-phase txn + orphan reconciliation (P0-2)
- CreateMintOrder 拆三段: txn1(PENDING→PROCESSING,不调RPC/不写asset)
  → 事务外 UpdateCrystalBalance 扣水晶 → txn2(建asset+registry→SUCCESS);
  消除 DB 事务内嵌跨服务 gRPC(连接池占用+跨服务事务风险)。
- 任一步失败 markMintOrderFailed 独立事务标 FAILED(不回滚已扣水晶=审计流水,
  重试靠 Task1 source_id 幂等 + Task2 入口短路防双扣); nil-cause 防御。
- 孤儿订单对账 ReconcileStuckMintOrders: 扫陈旧 PROCESSING 单,查 mint_cost 流水—
  已扣未建→FOR UPDATE 行锁下幂等补完 SUCCESS(串行化并发防双建),未扣→FAILED,绝不退款。
- main.go 接线周期 worker(MINT_RECONCILE_INTERVAL_SEC 默认600s,0关,优雅退出)。
- 测试: RPC失败落FAILED / 对账未扣→FAILED / 已扣未建→补完(含幂等二次跑)。

Co-Authored-By: Claude <noreply@anthropic.com>
2026-07-23 12:28:57 +08:00
..
activityService fix(backend): auth boundary — trusted identity from ctx (batch 2) 2026-07-23 01:12:35 +08:00
aiChatService fix(backend): auth boundary — trusted identity from ctx (batch 2) 2026-07-23 01:12:35 +08:00
assetService refactor(assetService): CreateMintOrder 3-phase txn + orphan reconciliation (P0-2) 2026-07-23 12:28:57 +08:00
galleryService fix(backend): auth boundary — trusted identity from ctx (batch 2) 2026-07-23 01:12:35 +08:00
moderationService fix(backend): auth boundary — trusted identity from ctx (batch 2) 2026-07-23 01:12:35 +08:00
notificationService fix(backend): auth boundary — trusted identity from ctx (batch 2) 2026-07-23 01:12:35 +08:00
socialService fix(backend): auth boundary — trusted identity from ctx (batch 2) 2026-07-23 01:12:35 +08:00
starbookService
statisticService
taskService fix(backend): auth boundary — trusted identity from ctx (batch 2) 2026-07-23 01:12:35 +08:00
userService fix(backend): auth boundary — trusted identity from ctx (batch 2) 2026-07-23 01:12:35 +08:00