Пример #1
0
 public static RfqEvent ToEventContract(this OperationExecutionInfoWithPause <SpecialLiquidationOperationData> o, RfqEventTypeContract eventType, string brokerId) =>
 new RfqEvent
 {
     EventType   = eventType,
     RfqSnapshot = new RfqContract
     {
         Id                   = o.Id,
         InstrumentId         = o.Data.Instrument,
         PositionIds          = o.Data.PositionIds,
         Volume               = o.Data.Volume,
         Price                = o.Data.Price,
         ExternalProviderId   = o.Data.ExternalProviderId,
         AccountId            = o.Data.AccountId,
         CausationOperationId = o.Data.CausationOperationId,
         CreatedBy            = string.IsNullOrEmpty(o.Data.AdditionalInfo)
                 ? null
                 : Deserialize(o.Data.AdditionalInfo)?.CreatedBy,
         OriginatorType = (RfqOriginatorType)o.Data.OriginatorType,
         RequestNumber  = o.Data.RequestNumber,
         RequestedFromCorporateActions = o.Data.RequestedFromCorporateActions,
         State        = (RfqOperationState)o.Data.State,
         LastModified = o.LastModified,
         Pause        = IRfqPauseService.CalculatePauseSummary(o).ToEventContract()
     },
     BrokerId = brokerId
 };
Пример #2
0
 public static RfqWithPauseSummary ToRfqWithPauseSummary(this OperationExecutionInfoWithPause <SpecialLiquidationOperationData> o)
 {
     return(new RfqWithPauseSummary
     {
         Id = o.Id,
         InstrumentId = o.Data.Instrument,
         PositionIds = o.Data.PositionIds,
         Volume = o.Data.Volume,
         Price = o.Data.Price,
         ExternalProviderId = o.Data.ExternalProviderId,
         AccountId = o.Data.AccountId,
         CausationOperationId = o.Data.CausationOperationId,
         CreatedBy = string.IsNullOrEmpty(o.Data.AdditionalInfo)
             ? null
             : Deserialize(o.Data.AdditionalInfo)?.CreatedBy,
         OriginatorType = o.Data.OriginatorType,
         RequestNumber = o.Data.RequestNumber,
         RequestedFromCorporateActions = o.Data.RequestedFromCorporateActions,
         State = o.Data.State,
         LastModified = o.LastModified,
         PauseSummary = IRfqPauseService.CalculatePauseSummary(o)
     });
 }