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