namespace YLErp.DBModels
{
///
/// 保证金配置期限常量定义(利率债TRS)
///
public static class ConsMarginTerm
{
///
/// 5年以下(同时也是兜底默认期限)
///
public const string UnderFiveYear = "<5y";
///
/// 5年-10年
///
public const string FiveToTenYear = "5y-10y";
///
/// 10年-30年
///
public const string TenToThirtyYear = "10y-30y";
///
/// 30年以上
///
public const string OverThirtyYear = ">30y";
///
/// 所有允许的期限值
///
public static readonly List AllowedTerms = new List
{
UnderFiveYear,
FiveToTenYear,
TenToThirtyYear,
OverThirtyYear
};
///
/// 验证期限是否有效
///
public static bool IsValidTerm(string term)
{
return AllowedTerms.Contains(term ?? string.Empty);
}
///
/// 获取期限的显示名称
///
public static string GetDisplayName(string term)
{
return term switch
{
UnderFiveYear => "<5y",
FiveToTenYear => "5y-10y",
TenToThirtyYear => "10y-30y",
OverThirtyYear => ">30y",
_ => term ?? "<5y"
};
}
}
}