hjhan
|
ef37c8e71d
|
refactor(swap): 合并多空名义本金参数为单一 posiTotalNotional 并加固测试
- DealInterests 的 posiLongNotionalValue + posiShortNotionalValue 合并为 posiTotalNotional(调用点以 posiLongNotional+posiShortNotional 求和传入),净减一个参数
- SwapDealService / SwapEodPositionService / InterestCalcRequest 同步收敛多空死管道参数
- 19 个测试调用点适配新签名
- SwapEodPositionServiceIntegrationTest 参数计数断言由裸数字改为参数名集合断言(CollectionAssert.AreEquivalent,对增删/重排/改名敏感)
|
2026-08-14 17:30:46 +08:00 |
|
hjhan
|
4a3fee9292
|
refactor(swap)+test: 删 GetInterests/CalcSwapInterests 死参数 needPrice/grossPrice;补工厂→接缝映射钉子
死参数收口(另一半):
- SwapDealService.GetInterests 删 needPrice/grossPrice(体内零消费,2026-08 验证);
InitSwapDealInterest.needPrice 同为死参数一并删
- SwapEodPositionService.CalcSwapInterests 签名+转发同步;两个 EOD 生产调用点
(SaveAutoEodInterestPosition/SaveEodInterestPositionCopy) 重排实参;
CalcEodPostCloseSettleInterests/GetIntradayUnwindInterests 委托同步
- 14 个测试文件 ~44 处直调点机械更新(8 处 override 签名 + 36 处调用实参)
- 注意:EOD 编排链(DealInterests→Save*家族)的 grossPrice(期初不含费价)有真实用途,保留未动
新增钉子:CalcEodPostCloseSettleInterests 工厂→接缝参数映射测试——
CalcSwapInterestsCapture 捕获 stub 断言 EodPostCloseSettle 的完整转发契约
(posi=平仓后剩余/closePosi=平掉额/恒1/settment:false/orginPv 等 11 项)。
该段位置转发含三个相邻同型 decimal,编译器不查错位,此测试兜底。
验证:定向 241 测试通过(含 T0/T1 Excel 验证期望值、EntrySemantics 精确值钉子——
任何 decimal 错位即红);全量 903=145失败/746通过/12跳过,与基线逐位一致。
|
2026-08-14 16:57:56 +08:00 |
|
hjhan
|
9d8cfb5ad0
|
refactor(accrual): 拆分FundingLegAccrual→SimpleInterestAccrual/CompoundInterestAccrual
单利与复利语义完全不同(单利本金恒定/复利重置日并本金),
拆成两个独立静态类,各自只含自己的方法:
SimpleInterestAccrual:
- AccrueEod (原AccrueSimpleEod)
- AccruePeriod (原AccrueSimplePeriod)
CompoundInterestAccrual:
- EodBasis (原CompoundEodBasis)
- AccrueEod (原AccrueCompoundEod)
- AccruePeriod (原AccrueCompoundPeriod)
方法名去掉Simple/Compound前缀(类名已携带类型),消除冗余
SwapModule零回归(7基线/510通过)
|
2026-08-12 13:40:47 +08:00 |
|
hjhan
|
85746d7ee9
|
test(accrual): 新增同日双次部分平仓字符化测试 + EOD基数快照replay诊断
- SwapUnwindSameDayDoublePartialTest: 内存Stub驱动同日两次部分平仓(30%/50%),
验证基数线性累加(0.3N+0.35N=0.65N),推翻"基数不滚动"假设;缺口仅在
调用方是否传陈旧notional,已文档化
- GLMS20260805ClosePercentDiffDiagnoseTest: 从Resources快照反序列化离线重跑
EOD基数诊断,去DB化;无快照Inconclusive,保留Assert.Fail作8/5 bug护栏
|
2026-08-12 11:28:40 +08:00 |
|