예제 #1
0
        public Ativos(
            User user,
            PosicaoConsolidadaCDBComCDIFactory cdbFactory,
            PosicaoConsolidadaSwingTradeFactory swingTradeFactory,
            PosicaoConsolidadaCryptoCurrencyFactory cryptoCurrencyFactory
            )
        {
            PosicoesConsolidadasCDBComCDI =
                user.CDBsComCDI.Select(cdb => cdbFactory.ObterPosicaoConsolidada(cdb)).ToList();

            PosicoesConsolidadasSwingTrade =
                user.SwingTrades.Select(st => swingTradeFactory.ObterPosicaoConsolidada(st)).ToList();

            PosicoesConsolidadasCryptoWallet =
                user.CryptoWallets.Select(c => cryptoCurrencyFactory.ObterPosicaoConsolidada(c)).ToList();

            TotalCDIeSELIC = PosicoesConsolidadasCDBComCDI.Sum(cdb => cdb.ValorLiquido);

            TotalRendaVariavel = PosicoesConsolidadasSwingTrade.Sum(x => x.ValorBruto);

            TotalCryptoCurrency = PosicoesConsolidadasCryptoWallet.Sum(b => b.ValorBruto);


            TotalCDIeSELICPorcent      = TotalCDIeSELIC / ValorBruto();
            TotalRendaVariavelPorcent  = TotalRendaVariavel / ValorBruto();
            TotalCryptoCurrencyPorcent = TotalCryptoCurrency / ValorBruto();
        }
예제 #2
0
 public CDBsComCDIController(FinanceiroDbContext context,
                             UserManager <User> userManager,
                             PosicaoConsolidadaCDBComCDIFactory factory)
 {
     _db          = context;
     _userManager = userManager;
     _factory     = factory;
 }
예제 #3
0
 public ResumoController(FinanceiroDbContext context,
                         PosicaoConsolidadaCDBComCDIFactory cdbFactory,
                         PosicaoConsolidadaSwingTradeFactory swingTradeFactory,
                         PosicaoConsolidadaCryptoCurrencyFactory cryptoCurrencyFactory)
 {
     _db                    = context;
     _cdbFactory            = cdbFactory;
     _swingTradeFactory     = swingTradeFactory;
     _cryptoCurrencyFactory = cryptoCurrencyFactory;
 }