refactor(interest): SwapDealService 接入 FundingLegRate 工厂并复用 FundingLegPrecision
取率处改用 Fixed/Floating 工厂;InterestCalculationPrecision 引用 SwapInterest.FundingLegPrecision,消除重复常量定义。
This commit is contained in:
@@ -114,8 +114,8 @@ namespace YLErp.Modules.SwapModule
|
||||
return unwindData.ClosePercent == 1 || (remainingNotional == 0 && remainingQuantity == 0);
|
||||
}
|
||||
|
||||
// 待实现利息会进入 decimal(30,12) 日终快照
|
||||
private const int InterestCalculationPrecision = 12;
|
||||
// 待实现利息会进入 decimal(30,12) 日终快照;精度常量统一引用 SwapInterest.FundingLegPrecision,消除重复定义。
|
||||
private const int InterestCalculationPrecision = SwapInterest.FundingLegPrecision;
|
||||
|
||||
/// <summary>
|
||||
/// 手工平仓、手工互换及收益结算的利息事件按金额两位落库。
|
||||
@@ -1583,8 +1583,8 @@ namespace YLErp.Modules.SwapModule
|
||||
// 利率构成按腿型封装:固定腿 → FixedRate;浮动腿 → Spread + IndexFixing(沿用旧实现 InterestRate+浮动利率 的口径)。
|
||||
var isFixedLeg = string.IsNullOrEmpty(position.FloatRateUnderlyingCode);
|
||||
var legRate = isFixedLeg
|
||||
? new FundingLegRate(fixedRate: flowEvent.InterestRate)
|
||||
: new FundingLegRate(spread: flowEvent.InterestRate, indexFixing: effectiveFloat);
|
||||
? FundingLegRate.Fixed(flowEvent.InterestRate)
|
||||
: FundingLegRate.Floating(flowEvent.InterestRate, effectiveFloat);
|
||||
var accrualPolicy = new AccrualPolicy(
|
||||
convention: AccrualBoundary.Both,
|
||||
isCompound: false,
|
||||
|
||||
Reference in New Issue
Block a user