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
..
2025-08-29 14:43:24 +08:00
2024-05-09 14:06:26 +08:00
2025-09-11 14:18:51 +08:00
2024-05-09 14:06:26 +08:00
2026-03-25 10:24:48 +08:00
2026-07-01 18:40:48 +08:00
2026-06-26 16:06:13 +08:00
2026-07-02 08:28:13 +08:00
2024-06-05 14:37:30 +08:00
2024-05-09 14:06:26 +08:00
2025-04-14 16:31:35 +08:00
2026-06-26 16:06:13 +08:00
2025-09-11 14:18:51 +08:00
2026-06-08 18:11:50 +08:00
2024-05-09 14:06:26 +08:00
2024-05-09 14:06:26 +08:00
2026-01-26 17:35:56 +08:00
2025-10-16 13:13:32 +08:00
2026-07-01 09:53:44 +08:00
2026-05-28 15:16:32 +08:00
2024-05-09 14:06:26 +08:00
2024-05-09 14:06:26 +08:00
2024-06-04 18:19:49 +08:00