hjhan
014edaed45
refactor(swap): ComposePage接缝-7虚方法+DB调用替换(testable迁移)
ComposePage(流水合成持仓)是swap_flow_event→swap_position的核心转换,
每笔开仓/平仓/互换都经过这里(176行)。
新增7个protected virtual虚方法(Seams):
- FindTrade/FindTradeExtend/FindSwapPositions
- FindEodSwapPositions/FindEodSwap
- AddSwapEvent/ExecuteInTransaction
ComposePage内部DB调用替换为调虚方法:
- DbContext.trade.Find → FindTrade
- DbContext.trade_extend.FirstOrDefault → FindTradeExtend
- DbContext.eod_swap_position.Where → FindEodSwapPositions
- DbContext.swap_position.Where → FindSwapPositions
- DbContext.eod_swap.FirstOrDefault → FindEodSwap
- new SwapEventService.AddSwapEventDate → AddSwapEvent
- DbContext.SaveChanges → SaveAllChanges(已有)
- ComposePage可见性private→protected
生产代码行为不变(虚方法默认实现=原逻辑)。
验证: 100个测试全通过(T0/T1=89+DealInterests=7+ConsumedInterest=4)。
2026-07-02 08:28:13 +08:00
..
2026-04-21 15:49:44 +08:00
2026-03-20 14:07:43 +08:00
2024-05-09 14:06:26 +08:00
2024-05-09 14:06:26 +08:00
2024-05-09 14:06:26 +08:00
2024-05-09 14:06:26 +08:00
2026-03-24 10:21:33 +08:00
2026-03-24 10:21:33 +08:00
2025-09-09 11:39:12 +08:00
2024-05-22 17:59:07 +08:00
2025-04-16 17:09:22 +08:00
2024-05-09 14:06:26 +08:00
2024-05-09 14:06:26 +08:00
2024-05-09 14:06:26 +08:00
2026-04-21 15:49:44 +08:00
2024-05-09 14:06:26 +08:00
2024-05-09 14:06:26 +08:00
2025-11-10 16:53:06 +08:00
2024-05-09 14:06:26 +08:00
2026-03-25 10:24:48 +08:00
2024-05-09 14:06:26 +08:00
2024-05-09 14:06:26 +08:00
2026-04-29 17:50:15 +08:00
2024-05-09 14:06:26 +08:00
2024-05-09 14:06:26 +08:00
2024-05-09 14:06:26 +08:00
2024-05-09 14:06:26 +08:00
2026-03-19 17:40:58 +08:00
2026-06-29 18:34:46 +08:00
2024-05-09 14:06:26 +08:00
2024-05-09 14:06:26 +08:00
2026-06-30 09:59:31 +08:00
2024-05-09 14:06:26 +08:00
2026-03-11 15:04:10 +08:00
2024-05-09 14:06:26 +08:00
2024-05-09 14:06:26 +08:00
2024-05-09 14:06:26 +08:00
2026-04-21 14:32:16 +08:00
2026-07-02 08:28:13 +08:00
2026-05-21 10:57:14 +08:00
2024-05-09 14:06:26 +08:00
2024-05-09 14:06:26 +08:00
2024-05-09 14:06:26 +08:00
2024-05-09 14:06:26 +08:00
2024-05-09 14:06:26 +08:00
2026-06-30 11:23:21 +08:00
2024-05-09 14:06:26 +08:00
2026-03-03 18:17:37 +08:00
2026-06-09 16:17:48 +08:00
2024-05-09 14:06:26 +08:00
2024-05-09 14:06:26 +08:00
2024-05-09 14:06:26 +08:00
2024-05-09 14:06:26 +08:00