示例#1
0
        private void GetInvestments(AllInvestment allInvestment, InvestmentResponse result)
        {
            foreach (var tesouroDireto in allInvestment.TesouroDiretoResponse.TesourosDireto)
            {
                var investment = new Responses.Investment();
                CalculationTesouro(investment, tesouroDireto);

                _investments.Add(investment);
            }

            foreach (var fundos in allInvestment.FundosResponse.Fundos)
            {
                var investment = new Responses.Investment();
                CalculationFundos(investment, fundos);

                _investments.Add(investment);
            }


            foreach (var rendaFixa in allInvestment.LciResponse.Lcis)
            {
                var investment = new Responses.Investment();
                CalculationRendaFixa(investment, rendaFixa);

                _investments.Add(investment);
            }

            result.Investimentos = _investments;
        }
示例#2
0
        private void CalculationRendaFixa(Responses.Investment investment, Lcis lcis)
        {
            const decimal discountPercentage = 0.05m;

            investment.Nome           = lcis.Nome;
            investment.ValorInvestido = lcis.CapitalInvestido;
            investment.ValorTotal     = lcis.CapitalAtual;
            investment.Vencimento     = lcis.Vencimento;
            investment.Ir             = (lcis.CapitalAtual - lcis.CapitalInvestido) * discountPercentage;
            investment.ValorResgate   = CalculationRescue(lcis.Vencimento, lcis.DataOperacao, DateTime.Today, lcis.CapitalAtual);
        }
示例#3
0
        private void CalculationFundos(Responses.Investment investment, Fundos fundos)
        {
            const decimal discountPercentage = 0.15m;

            investment.Nome           = fundos.Nome;
            investment.ValorInvestido = fundos.CapitalInvestido;
            investment.ValorTotal     = fundos.ValorAtual;
            investment.Vencimento     = fundos.DataResgate;
            investment.Ir             = (fundos.ValorAtual - fundos.CapitalInvestido) * discountPercentage;
            investment.ValorResgate   = CalculationRescue(fundos.DataResgate, fundos.DataCompra, DateTime.Today, fundos.ValorAtual);
        }
示例#4
0
        public void CalculationTesouro(Responses.Investment investment, TesouroDireto tesouroDireto)
        {
            const decimal discountPercentage = 0.1m;

            investment.Nome           = tesouroDireto.Nome;
            investment.ValorInvestido = tesouroDireto.ValorInvestido;
            investment.ValorTotal     = tesouroDireto.ValorTotal;
            investment.Vencimento     = tesouroDireto.Vencimento;
            investment.Ir             = (tesouroDireto.ValorTotal - tesouroDireto.ValorInvestido) * discountPercentage;
            investment.ValorResgate   = CalculationRescue(tesouroDireto.Vencimento, tesouroDireto.DataDeCompra, DateTime.Today, tesouroDireto.ValorTotal);
        }