Example #1
0
        public async Task <List <CurrencyConvertion> > ListRates()
        {
            List <Business.Model.CurrencyConvertion> originData = await business.ListRates();

            List <CurrencyConvertion> rates = mapper.Map <List <CurrencyConvertion> >(originData);

            return(rates);
        }
Example #2
0
        public async Task <Sku> GetTransactionsBySku(string sku)
        {
            List <CurrencyConvertion> Rates = await rateBusiness.ListRates();

            List <Data.Model.Transaction> originData   = data.GetTransactionsBySku(sku);
            List <Transaction>            transactions = mapper.Map <List <Transaction> >(originData);

            PassTransactionsToDefualtCurrency(Rates, transactions);
            transactions = transactions.OrderBy(o => o.Currency).ToList();
            decimal total = transactions.Sum(o => o.Amount);

            total = bankCalculus.RoundBank(total);

            Sku skuModel = new Sku
            {
                Name         = sku,
                Transactions = transactions,
                Total        = total
            };

            return(skuModel);
        }