using Newtonsoft.Json; using System.ComponentModel; using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; using System.Xml.Serialization; using YLErp.Modules.SuperviseReportModule.SAC.Common; using static YLErp.DBModels.Consts.ConsReport; namespace YLErp.Modules.SuperviseReportModule.SAC.Model { /// /// 了结确认书 /// [Table("A1007_OptionTermination")] 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; } /// /// 操作事件编号 /// 长度:6 /// 必填:是 /// /// 说明:存续期发生相关事件时,必填; /// 同一笔交易确认书下应当保证唯一性,并按照事件发生顺序进行编号,起始编号为0000. /// 如一笔交易下依次发生展期\调仓\终止事件,编号应当分别为0000\0001\0002, /// 场外业务报告系统返回编号分别为E0000\R0001\T0002 /// /// [CheckStringLengthInMap(Map = new[] { 4, 5 })] [DefaultValue("")] [SacDescription("DurationEventNO", "操作事件编号", "6", true, "存续期发生相关事件时,必填;\r\n同一笔交易确认书下应当保证唯一性,并按照事件发生顺序进行编号,起始编号为0000.\r\n如一笔交易下依次发生展期、调仓、终止事件,编号应当分别为0000、0001、0002,\r\n场外业务报告系统返回编号分别为E0000、R0001、T0002;")] public new string DurationEventNO { get; set; } /// /// 交易确认书编号(双方约定) /// 长度:100 /// 必填:是 /// 说明:双方约定; /// [CheckStringMaxLength(MaxLength = 100)] [DefaultValue("")] [SacDescription("ConfirmationNo", "交易确认书编号(双方约定)", "100", true, "双方约定;")] public string ConfirmationNo { get; set; } /// /// 存续期操作类型 /// 长度:2 /// 必填:是 /// 说明:敲入、敲出只限于自动赎回、安全气囊、障碍及其组合类期权填写 /// [CheckStringInMap(Map = new[] { "01", "02", "03", "05", "06" })] [DefaultValue("")] [SacDescription("DurationOperationType", "存续期操作类型", "2", true, "敲入、敲出只限于自动赎回、安全气囊、障碍及其组合类期权填写")] public string DurationOperationType { get; set; } /// /// 操作发生日期 /// 长度:10 /// 必填:是 /// 说明:分别为“确定进行展期日期”“合约终止日期”“交易发生违约日期”“发生敲入事件日期”“发生敲出事件日期” /// // [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)] [CheckStringIsDateTimeFormat()] // [CheckStringMaxLength(MaxLength = 0, Required = false, CheckHandleName = "B")] [DefaultValue("")] [SacDescription("ExpirationDate", "操作发生日期", "10", true, "分别为“确定进行展期日期”“合约终止日期”“交易发生违约日期”“发生敲入事件日期”“发生敲出事件日期”")] public string ExpirationDate { get; set; } /// /// 展期后到期日 /// 长度:10 /// 必填:否 /// 说明:当“存续期操作类型”为“展期”时,必填;不存在展期操作数据,不得早于原合约到期日;存在展期操作数据,不得早于最近一次展期数据的“展期后到期日” /// [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, "当“存续期操作类型”为“展期”时,必填;不存在展期操作数据,不得早于原合约到期日;存在展期操作数据,不得早于最近一次展期数据的“展期后到期日”")] public string RenewalDate { get; set; } /// /// 违约方 /// 长度:2 /// 必填:否 /// 说明:当"存续期操作类型"为"违约终止"时,必填 /// [CheckConditionStringValue(ConditionName = nameof(DurationOperationType), ConditionValue = "03", CheckHandleNameArr = new[] { "A" })] [CheckConditionStringNEQValue(ConditionName = nameof(DurationOperationType), ConditionValue = "03", CheckHandleNameArr = new[] { "B" })] [CheckStringInMap(Map = new[] { "0", "1" }, CheckHandleName = "A")] [CheckStringLength(Length = 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; } /// /// 名义本金变动(元) /// 长度:36,2 /// 必填:否 /// 说明:当"存续期操作类型"选择"终止""违约终止"时,必填,数值必须为负数 /// [CheckConditionStringInMap(ConditionName = nameof(DurationOperationType), ConditionMap = new[] { "02", "03" }, CheckHandleNameArr = new[] { "A" })] [CheckConditionStringNotInMap(ConditionName = nameof(DurationOperationType), ConditionMap = new[] { "02", "03" }, CheckHandleNameArr = new[] { "B" })] [CheckStringIntLength(BeforePointMaxLength = 36, AfterPointLength = 2, MaxValue = 0, CheckHandleName = "A")] [CheckStringLength(Length = 0, Required = false, CheckHandleName = "B")] [DefaultValue("")] [SacDescription("TerminationAmount", "名义本金变动(元)", "36,2", false, "当存续期操作类型选择终止、违约终止时,必填,数值必须为负数;")] public string TerminationAmount { get; set; } /// /// 存量名义本金(元) /// 长度:36,2 /// 必填:是 /// 说明:大于等于 0 的数字 /// [CheckStringIntLength(AfterPointLength = 2, BeforePointMaxLength = 36, MinValue = 0)] [DefaultValue("")] [SacDescription("Balance", "存量名义本金(元)", "36,2", true, "大于等于 0 的数字")] public string Balance { get; set; } /// /// 本次支付金额(元) /// 长度:36,2 /// 必填:否 /// 说明:校验规则:1 当存续期操作类型,选择终止\违约终止时必填;2 支付为正,收取为负 /// [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 = 36, CheckHandleName = "A")] [CheckStringMaxLength(MaxLength = 0, Required = false, CheckHandleName = "B")] [DefaultValue("")] [SacDescription("AmountPaidThisTime", "本次支付金额(元)", "36,2", false, "校验规则:\r\n1 当存续期操作类型,选择终止、违约终止时必填;\r\n2 支付为正,收取为负;")] public string AmountPaidThisTime { get; set; } /// /// 已了结交易实际收益率(%) /// 长度:8,2 /// 必填:否 /// 说明:当“存续期操作类型”选择“终止”“违约终止”时,必填; /// [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 = 8, CheckHandleName = "A")] [CheckStringMaxLength(MaxLength = 0, Required = false, CheckHandleName = "B")] [DefaultValue("")] [SacDescription("ClosedTransactionsRealRateReturn", "已了结交易实际收益率(%)", "8,2", false, "当“存续期操作类型”选择“终止”“违约终止”时,必填;")] public string ClosedTransactionsRealRateReturn { get; set; } /// /// 存续期信息附件 /// 长度: /// 必填:否 /// 说明:校验规则:只支持 PDF 格式 /// [CheckStringEndsWith(EndsWithString = ".pdf", Required = false)] [DefaultValue("")] [SacDescription("OptionDurationManagementAtt", "存续期信息附件", "", false, "校验规则:只支持 PDF 格式")] public string OptionDurationManagementAtt { get; set; } /// /// 障碍事件状态 /// 长度:2 /// 必填:否 /// 说明:根据存续期操作类型中 05 敲入、06 敲出的填写情况,由系统自动取值,填报方无需填写报送 /// [CheckStringMaxLength(MaxLength = 2, Required = false)] [DefaultValue("")] [SacDescription("BarrierEventStatus", "障碍事件状态", "2", false, "根据存续期操作类型中 05 敲入、06 敲出的填写情况,由系统自动取值,填报方无需填写报送")] public string BarrierEventStatus { get; set; } [XmlIgnore] [DefaultValue("")] [SacDescription("TradeId", "本次支付金额", "36,2", false, "校验规则:\r\n1 当存续期操作类型,选择终止、违约终止时必填;\r\n2 保留两位小数;\r\n3 TODO 选展期时,该字段不能填,否则报送失败;")] public string TradeId { get; set; } /// /// 空白1 /// [XmlIgnore] [DefaultValue("")] [SacDescription("Blank1", "空白1", "", false, "")] public string Blank1 { get; set; } /// /// 空白2 /// [XmlIgnore] [DefaultValue("")] [SacDescription("Blank2", "空白2", "", false, "")] public string Blank2 { get; set; } } }