public void Update(TransactionsDto dto)
        {
            var domain = repository.GetByPKs(dto.Sku, dto.Currency);

            DomainServicesMapper.MapToTransactions(dto, domain);
            repository.Update(domain);
            Logger.AddLOGMsg($"Updated Transaction with Amount -> {dto.Amount} Sku -> {dto.Sku} Currency -> {dto.Currency}");
        }
        public void Add(TransactionsDto dto)
        {
            var domain = new Transactions();

            DomainServicesMapper.MapToTransactions(dto, domain);
            repository.Add(domain);
            Logger.AddLOGMsg($"Add Transaction with Amount -> {dto.Amount} Sku -> {dto.Sku} Currency -> {dto.Currency}");
        }
 private TransactionsDto ChangeCurrencyToEuro(TransactionsDto dto)
 {
     Logger.AddLOGMsg($"ChangeCurrencyToEuro. Currency: {dto.Currency}");
     if (dto.Currency != "EUR")
     {
         var howChangeToEuro = _ratesDomainServices.HowToChangeFromOneCurrencyToAnother(dto.Currency, "EUR");
         var from            = dto.Currency;
         var amountTemp      = dto.Amount;
         foreach (var currency in howChangeToEuro)
         {
             var rateDto = _ratesDomainServices.GetByIds(from, currency);
             from       = currency;
             amountTemp = amountTemp * rateDto.Rate;
         }
         if (howChangeToEuro.Any())
         {
             dto.Currency = "EUR";
             dto.Amount   = decimal.Round(amountTemp, 2, MidpointRounding.AwayFromZero);
         }
     }
     return(dto);
 }
        public void Delete(TransactionsDto dto)
        {
            var domain = repository.GetByPKs(dto.Sku, dto.Currency);

            repository.Delete(domain);
        }