using System.ComponentModel;
using System.Xml.Serialization;
using YLErp.Modules.SuperviseReportModule.SAC.Common;
using static YLErp.DBModels.Consts.ConsReport;
namespace YLErp.Modules.SuperviseReportModule.SAC.Model
{
public class OptionTerminationModel : ReportBaseModel
{
///
/// 操作标识
/// 长度:1
/// 必填:是
/// 说明:
///
[XmlIgnore]
[SacDescription("OperationType", "操作标识", "1", true, "")]
public OptFlagsEnum OperationType { get; set; }
///
/// 业务编号
/// 长度:50
/// 必填:否
/// 说明:校验规则:补正时必填;
///
[CheckConditionStringValue(ConditionName = nameof(OperationType), ConditionValue = "A", CheckHandleNameArr = new[] { "B" })]
[CheckConditionStringNEQValue(ConditionName = nameof(OperationType), ConditionValue = "A", CheckHandleNameArr = new[] { "A" })]
[CheckStringMaxLength(MaxLength = 50, CheckHandleName = "A")]
[CheckStringMaxLength(MaxLength = 50, Required = false, CheckHandleName = "B")]
[DefaultValue("")]
[SacDescription("BizID", "业务编号", "50", false, "校验规则:补正时必填;")]
public new string BizID { get; set; }
///
/// 交易确认书编号(双方约定)
/// 长度:100
/// 必填:是
/// 说明:双方约定;
///
[CheckStringMaxLength(MaxLength = 100)]
[DefaultValue("")]
[SacDescription("ConfirmationNo", "交易确认书编号", "100", true, "双方约定;")]
public string ConfirmationNo { get; set; }
///
/// 终止日期
/// 长度:10
/// 必填:是
/// 说明:校验规则:1 当存续期操作类型,选择终止\违约终止时必填;2 必须是yyyy-MM-dd;3 不存在展期数据:不得等于晚于原合约到期日;4 存在展期数据:不得等于晚于最新展期日期;5 新增终止:一个日期只能存在一条终止数据;
///
[CheckConditionStringInMap(ConditionName = nameof(DurationOperationType), ConditionMap = new[] { "02", "03" }, CheckHandleNameArr = new[] { "A" })]
[CheckConditionStringNotInMap(ConditionName = nameof(DurationOperationType), ConditionMap = new[] { "02", "03" }, CheckHandleNameArr = new[] { "B" })]
[CheckStringMaxLength(MaxLength = 10, CheckHandleName = "A")]
[CheckStringIsDateTimeFormat(CheckHandleName = "A")]
[CheckStringMaxLength(MaxLength = 0, Required = false, CheckHandleName = "B")]
[DefaultValue("")]
[SacDescription("ExpirationDate", "终止日期", "10", true, "校验规则:\r\n1 当存续期操作类型,选择终止、违约终止时必填;\r\n2 必须是yyyy-MM-dd;\r\n3 不存在展期数据:不得等于晚于原合约到期日;\r\n4 存在展期数据:不得等于晚于最新展期日期;\r\n5 新增终止:一个日期只能存在一条终止数据;")]
public string ExpirationDate { get; set; }
///
/// 违约方
/// 长度:2
/// 必填:否
/// 说明: 校验规则:存续期操作类型为违约终止时必填;
///
[CheckConditionStringValue(ConditionName = nameof(DurationOperationType), ConditionValue = "03", CheckHandleNameArr = new[] { "A" })]
[CheckConditionStringNEQValue(ConditionName = nameof(DurationOperationType), ConditionValue = "03", CheckHandleNameArr = new[] { "B" })]
[CheckStringInMap(Map = new[] { "01", "02" }, CheckHandleName = "A")]
[CheckStringMaxLength(MaxLength = 0, Required = false, CheckHandleName = "B")]
[DefaultValue("")]
[SacDescription("DefaultingParty", "违约方", "2", false, "校验规则:存续期操作类型为违约终止时必填;")]
public string DefaultingParty { get; set; }
///
/// 违约事件说明
/// 长度:1024
/// 必填:否
/// 说明:校验规则:存续期操作类型为违约终止时必填;
///
[CheckConditionStringValue(ConditionName = nameof(DurationOperationType), ConditionValue = "03", CheckHandleNameArr = new[] { "A" })]
[CheckConditionStringNEQValue(ConditionName = nameof(DurationOperationType), ConditionValue = "03", CheckHandleNameArr = new[] { "B" })]
[CheckStringMaxLength(MaxLength = 1024, CheckHandleName = "A")]
[CheckStringMaxLength(MaxLength = 0, Required = false, CheckHandleName = "B")]
[DefaultValue("")]
[SacDescription("DefaultEvent", "违约事件说明", "1024", false, "校验规则:存续期操作类型为违约终止时必填;")]
public string DefaultEvent { get; set; }
///
/// 展期日期
/// 长度:10
/// 必填:否
/// 说明:校验规则:1 存续期操作类型为展期时必填;2 必须是yyyy-MM-dd;3 不存在展期数据:不得早于等于原合约到期日;4 存在展期数据:不得早于等于最新展期日期;5 新增终止:一个日期只能存在一条终止数据;
///
[CheckConditionStringValue(ConditionName = nameof(DurationOperationType), ConditionValue = "01", CheckHandleNameArr = new[] { "A" })]
[CheckConditionStringNEQValue(ConditionName = nameof(DurationOperationType), ConditionValue = "01", CheckHandleNameArr = new[] { "B" })]
[CheckStringMaxLength(MaxLength = 10, CheckHandleName = "A")]
[CheckStringIsDateTimeFormat(CheckHandleName = "A")]
[CheckStringMaxLength(MaxLength = 0, Required = false, CheckHandleName = "B")]
[DefaultValue("")]
[SacDescription("RenewalDate", "展期日期", "10", false, "校验规则:\r\n1 存续期操作类型为展期时必填;\r\n2 必须是yyyy-MM-dd;\r\n3 不存在展期数据:不得早于等于原合约到期日;\r\n4 存在展期数据:不得早于等于最新展期日期;\r\n5 新增终止:一个日期只能存在一条终止数据;")]
public string RenewalDate { get; set; }
///
/// 存续期操作类型
/// 长度:2
/// 必填:是
/// 说明:
///
[CheckStringInMap(Map = new[] { "01", "02", "03" })]
[DefaultValue("")]
[SacDescription("DurationOperationType", "存续期操作类型", "2", true, "")]
public string DurationOperationType { get; set; }
///
/// 本次终止金额
/// 长度:36,2
/// 必填:否
/// 说明:校验规则:1 当存续期操作类型,选择终止\违约终止时必填;2 保留两位小数;3 TODO 选展期时,该字段不能填,否则报送失败.4 大于0且小于等于上次余额;
///
[CheckConditionStringInMap(ConditionName = nameof(DurationOperationType), ConditionMap = new string[] { "02", "03" }, CheckHandleNameArr = new[] { "A" })]
[CheckConditionStringNotInMap(ConditionName = nameof(DurationOperationType), ConditionMap = new string[] { "02", "03" }, CheckHandleNameArr = new[] { "B" })]
[CheckStringIntLength(AfterPointLength = 2, BeforePointMaxLength = 34, MinValue = 0.01, CheckHandleName = "A")]
[CheckStringLength(Length = 0, Required = false, CheckHandleName = "B")]
[DefaultValue("")]
[SacDescription("TerminationAmount", "本次终止金额", "36,2", false, "校验规则:\r\n1 当存续期操作类型,选择终止、违约终止时必填;\r\n2 保留两位小数;\r\n3 TODO 选展期时,该字段不能填,否则报送失败.4 大于0且小于等于上次余额;")]
public string TerminationAmount { get; set; }
///
/// 余额
/// 长度:36,2
/// 必填:是
/// 说明:校验规则:1 保留两位小数;2 值等于该交易上次余额-本次终止金额;
///
[CheckStringIntLength(AfterPointLength = 2, BeforePointMaxLength = 34, MinValue = 0)]
[DefaultValue("")]
[SacDescription("Balance", "余额", "36,2", true, "校验规则:\r\n1 保留两位小数;\r\n2 值等于该交易上次余额-本次终止金额;")]
public string Balance { get; set; }
///
/// 本次支付金额
/// 长度:36,2
/// 必填:否
/// 说明:校验规则:1 当存续期操作类型,选择终止\违约终止时必填;2 保留两位小数;3 TODO 选展期时,该字段不能填,否则报送失败;
///
[CheckConditionStringInMap(ConditionName = nameof(DurationOperationType), ConditionMap = new string[] { "02", "03" }, CheckHandleNameArr = new[] { "A" })]
[CheckConditionStringNotInMap(ConditionName = nameof(DurationOperationType), ConditionMap = new string[] { "02", "03" }, CheckHandleNameArr = new[] { "B" })]
[CheckStringIntLength(AfterPointLength = 2, BeforePointMaxLength = 34, CheckHandleName = "A")]
[CheckStringLength(Length = 0, Required = false, CheckHandleName = "B")]
[DefaultValue("")]
[SacDescription("AmountPaidThisTime", "本次支付金额", "36,2", false, "校验规则:\r\n1 当存续期操作类型,选择终止、违约终止时必填;\r\n2 保留两位小数;\r\n3 TODO 选展期时,该字段不能填,否则报送失败;")]
public string AmountPaidThisTime { get; set; }
[XmlIgnore]
[DefaultValue("")]
[SacDescription("TradeId", "本次支付金额", "36,2", false, "校验规则:\r\n1 当存续期操作类型,选择终止、违约终止时必填;\r\n2 保留两位小数;\r\n3 TODO 选展期时,该字段不能填,否则报送失败;")]
public string TradeId { get; set; }
}
}