Example #1
0
        public static ReembolsosCsvRow FromCsv(string csvLine)
        {
            string[] values = csvLine.Split(',');

            ReembolsosCsvRow csvRow = new ReembolsosCsvRow
            {
                TimestampUTC      = Convert.ToDateTime(values[0]),
                TradeFeeCurrency  = values[1],
                TradeFeeAmount    = Convert.ToDecimal(values[2], CultureInfo.InvariantCulture),
                RebatePercentage  = values[3],
                RebateCurrency    = values[4],
                RebateAmount      = Convert.ToDecimal(values[5], CultureInfo.InvariantCulture),
                RebateDestination = values[6],
                Status            = Convert.ToInt32(values[7])
            };

            return(csvRow);
        }
        private static Transaccion CreateReembolso(ReembolsosCsvRow row)
        {
            Transaccion transaccion = new Transaccion
            {
                Id              = Guid.NewGuid(),
                Exchange        = "crypto.com_exchange",
                Divisa_Compra   = row.RebateCurrency,
                Cantidad_Compra = row.RebateAmount,
                Detalles        = string.Concat(
                    row.RebatePercentage,
                    " of ", row.TradeFeeAmount, " ", row.TradeFeeCurrency,
                    " to ", row.RebateDestination),
                Fecha          = row.TimestampUTC,
                Alerta         = false,
                Mensaje_Alerta = "",
                Tipo           = "ingreso",
                Subtipo        = "fee_rebate"
            };

            return(transaccion);
        }
        public static Transaccion GetReembolso(string line)
        {
            var row = ReembolsosCsvRow.FromCsv(line);

            return(CreateReembolso(row));
        }