rwadurian/backend/services/contribution-service/prisma
hailin e1cd8ed7f2 feat(pre-planting): 3171 预种计划 2.0 算力集成(contribution-service CDC 模块)
Phase 5:将预种数据集成到 contribution-service 2.0 算力体系。

=== 新增文件(11 个) ===
- prisma/pre-planting/schema.prisma:独立 Prisma schema(4 张追踪表)
- PrePlantingPrismaService + Module:独立 PrismaClient
- PrePlantingCdcConsumerService:独立 CDC 消费者(consumer group: contribution-pre-planting-cdc)
- PrePlantingOrderSyncedHandler:订单 CDC handler + synced_adoptions marker 插入
- PrePlantingPositionSyncedHandler:持仓 CDC handler
- PrePlantingCdcDispatcher:CDC 事件分发器
- PrePlantingContributionService:1/5 算力计算(复用领域计算器)
- PrePlantingFreezeScheduler:每日冻结/解冻调度(凌晨 5 点)
- PrePlantingCdcModule:模块注册
- constants.ts:10B 偏移量、冻结期限等常量

=== 隔离保证 ===
- 独立 Kafka consumer group(contribution-pre-planting-cdc)
- 独立 CDC topics(cdc.pre-planting.public.*)
- 独立 Prisma schema + generated client
- sourceAdoptionId 使用 10,000,000,000 偏移避免 ID 冲突
- synced_adoptions marker: contributionDistributed=true + treeCount=0
- 不更新 NetworkAdoptionProgress(预种不推高全网算力系数)
- 现有代码文件零修改(仅 app.module.ts 加 1 行 import)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-18 05:25:14 -08:00
..
migrations refactor(contribution): 合并所有迁移到 0001_init 2026-01-21 04:31:52 -08:00
pre-planting feat(pre-planting): 3171 预种计划 2.0 算力集成(contribution-service CDC 模块) 2026-02-18 05:25:14 -08:00
schema.prisma feat(contribution): 添加系统账户算力来源类型字段 2026-01-21 04:23:50 -08:00