using YLErp.DBModels;
namespace YLErp.Models
{
///
/// 获取fixing的请求model
///
public class FixingRequestBase
{
public FixingRequestBase(DateTime valueDate, int tradeId,
string instrumentType, string underlyingCode, DateTime exerciseDate, SettlementTypeEnum settlementType)
{
TradeId = tradeId;
ValueDate = valueDate;
ExerciseDate = exerciseDate;
InstrumentType = instrumentType ?? throw new ArgumentNullException(nameof(instrumentType));
UnderlyingCode = underlyingCode ?? throw new ArgumentNullException(nameof(underlyingCode));
SettlementType = settlementType;
}
public FixingRequestBase(FixingRequestBase baseReq)
{
if (baseReq is null)
{
throw new ArgumentNullException(nameof(baseReq));
}
TradeId = baseReq.TradeId;
ValueDate = baseReq.ValueDate;
ExerciseDate = baseReq.ExerciseDate;
InstrumentType = baseReq.InstrumentType;
UnderlyingCode = baseReq.UnderlyingCode;
SettlementType = baseReq.SettlementType;
}
///
/// 交易ID
///
public int TradeId { get; }
///
/// 估值日期
///
public DateTime ValueDate { get; set; }
///
/// 执行日期
///
public DateTime ExerciseDate { get; }
///
/// 资产类型
///
public string InstrumentType { get; }
///
/// 标的代码
///
public string UnderlyingCode { get; }
///
/// 结算价格类型
///
public SettlementTypeEnum SettlementType { get; }
}
///
/// 获取fixing的请求model
///
public class FixingRequest : FixingRequestBase
{
public FixingRequest(DateTime valueDate, int tradeId, DateTime startDate, string observationDates
, string instrumentType, string underlyingCode, SettlementTypeEnum settlementType, DateTime exerciseDate)
: base(valueDate, tradeId, instrumentType, underlyingCode, exerciseDate, settlementType)
{
StartDate = startDate;
ObservationDates = observationDates;
}
public FixingRequest(FixingRequestBase baseReq, DateTime startDate, string observationDates) : base(baseReq)
{
StartDate = startDate;
ObservationDates = observationDates;
}
///
/// 开始日期
///
public DateTime StartDate { get; set; }
///
/// 观察日期序列
///
public string ObservationDates { get; set; }
}
}