Ejemplo n.º 1
0
 public void Apply(TradeCreatedEvent evt)
 {
     Id            = evt.TradeId;
     TraderName    = evt.TraderName;
     CurrencyPair  = evt.CurrencyPair;
     SpotRate      = evt.SpotRate;
     TradeDate     = evt.TradeDate;
     ValueDate     = evt.ValueDate;
     Direction     = (DirectionDto)Enum.Parse(typeof(DirectionDto), evt.Direction);
     Notional      = evt.Notional;
     DealtCurrency = evt.DealtCurrency;
     State         = TradeStatusDto.Pending;
 }
Ejemplo n.º 2
0
 public Trade(
     long tradeId,
     string traderName,
     string currencyPair,
     decimal notional,
     string dealtCurrency,
     DirectionDto direction,
     decimal spotRate,
     DateTimeOffset tradeDate,
     DateTimeOffset valueDate,
     TradeStatusDto status)
 {
     TradeId       = tradeId;
     TraderName    = traderName;
     CurrencyPair  = currencyPair;
     Notional      = notional;
     DealtCurrency = dealtCurrency;
     Direction     = direction;
     SpotRate      = spotRate;
     TradeDate     = tradeDate;
     ValueDate     = valueDate;
     Status        = status;
 }
 public Trade(
     long tradeId,
     string traderName,
     string currencyPair,
     decimal notional,
     string dealtCurrency,
     DirectionDto direction,
     decimal spotRate,
     DateTime tradeDate,
     DateTime valueDate,
     TradeStatusDto status)
 {
     TradeId = tradeId;
     TraderName = traderName;
     CurrencyPair = currencyPair;
     Notional = notional;
     DealtCurrency = dealtCurrency;
     Direction = direction;
     SpotRate = spotRate;
     TradeDate = tradeDate;
     ValueDate = valueDate;
     Status = status;
 }
Ejemplo n.º 4
0
 public void Apply(TradeRejectedEvent evt)
 {
     RejectReason = evt.Reason;
     State        = TradeStatusDto.Rejected;
 }
Ejemplo n.º 5
0
 public void Apply(TradeCompletedEvent evt)
 {
     State = TradeStatusDto.Done;
 }
        private static TradesDto CreateSingleEventUpdateDto(IDictionary <long, Trade> currentSotw, long tradeId, TradeStatusDto status)
        {
            var trade = currentSotw[tradeId];
            var dto   = trade.ToDto();

            dto.Status = status;
            return(new TradesDto(new[] { dto }, false, false));
        }