public SecurityPriceSave(ILogger <SecurityPriceSave> logger,
                                 IMapper mapper,
                                 IAppRepository <string> appRepository,
                                 IHttpClientFactory clientFactory)
        {
            this.logger        = logger;
            this.mapper        = mapper;
            this.appRepository = appRepository;

            //SQS
            sqs = new AmazonSQSClient(RegionEndpoint.USEast1);
            queueUrlResponse = sqs.GetQueueUrlAsync(QueueName).Result;

            //HttpClient
            client = clientFactory.CreateClient();

            //TDA
            apiKey = EnvHandler.GetApiKey(@"tdameritrade");

            //API Gateway key
            isrKey = EnvHandler.GetApiKey(@"ISRApiHandler");

            //Security list
            securityList = GetTickerList().Result;
        }
        public static IServiceCollection AddMongoRepository(this IServiceCollection services)
        {
            var mongoURL = EnvHandler.GetApiKey("InvestDb");

            services.AddSingleton <IAppRepository <string> >(r => new Repository <string>(mongoURL));
            return(services);
        }
 /// <summary>
 /// Initializes a new instance of the <see cref="ObtainFundamentals"/> class.
 /// </summary>
 /// <param name="logger">The logger.</param>
 /// <param name="resolveCompanyName">Name of the resolve company.</param>
 /// <param name="envHandler">The env handler.</param>
 /// <param name="connectionHandlerCF">The connection handler cf.</param>
 /// <param name="mapper">The mapper.</param>
 public ObtainFundamentals(ILogger <ObtainFundamentals> logger, ResolveCompanyName resolveCompanyName, EnvHandler envHandler, IDBConnectionHandler <PiotroskiScoreMd> connectionHandlerCF, IMapper mapper)
 {
     _logger              = logger;
     _resolveCompanyName  = resolveCompanyName;
     _envHandler          = envHandler;
     _connectionHandlerCF = connectionHandlerCF;
     _mapper              = mapper;
     _connectionHandlerCF.ConnectToDatabase("PiotroskiScore");
 }
        public static bool IsEnglish(this string inputString)
        {
            var    envHandler = new EnvHandler();
            var    key        = envHandler.GetApiKey(KeyForTraslator);
            string host       = HostName;
            string route      = RouteName;

            return(DetectTextRequest(key, host, route, inputString.TruncateAtWord(50)));
        }
Esempio n. 5
0
        public static void UseEnvActuator(IConfiguration configuration, IHostingEnvironment hostingEnvironment = null, ILoggerFactory loggerFactory = null)
        {
            var options = new EnvOptions(configuration);

            hostingEnvironment = hostingEnvironment ?? new DefaultHostingEnvironment("development");
            var ep      = new EnvEndpoint(options, configuration, hostingEnvironment, CreateLogger <EnvEndpoint>(loggerFactory));
            var handler = new EnvHandler(ep, SecurityService, CreateLogger <EnvHandler>(loggerFactory));

            ConfiguredHandlers.Add(handler);
        }
Esempio n. 6
0
 public ObtainFundamentals(ILogger <ObtainFundamentals> log,
                           ObtainCompanyDetails obtainCompanyDetails,
                           IDBConnectionHandler <PiotroskiScoreMd> connectionHandlerCF,
                           EnvHandler envHandler)
 {
     _log = log;
     _obtainCompanyDetails = obtainCompanyDetails;
     _connectionHandlerCF  = connectionHandlerCF;
     _envHandler           = envHandler;
     _connectionHandlerCF.ConnectToDatabase("PiotroskiScore");
 }
Esempio n. 7
0
 public ObtainGoodInvestments(ILogger <ObtainGoodInvestments> log,
                              IDBConnectionHandler <PiotroskiScoreMd> connectionHandlerCF,
                              IDBConnectionHandler <CompanyDetailMd> dbconCompany,
                              EnvHandler envHandler)
 {
     _log = log;
     _ratingsConnectionHandler = connectionHandlerCF;
     _dbconCompany             = dbconCompany;
     _envHandler = envHandler;
     _ratingsConnectionHandler.ConnectToDatabase("PiotroskiScore");
     _dbconCompany.ConnectToDatabase("CompanyDetail");
 }
Esempio n. 8
0
 public ResolveCompanyName(ILogger <ResolveCompanyName> logger, EnvHandler envHandler,
                           IDBConnectionHandler <SecuritySymbolMd> connectionHandlerSS,
                           IDBConnectionHandler <LastUpateCollectionMd> connectionHandlerLU,
                           IMapper mapper)
 {
     _logger              = logger;
     _envHandler          = envHandler;
     _connectionHandlerSS = connectionHandlerSS;
     _connectionHandlerLU = connectionHandlerLU;
     _mapper              = mapper;
     _connectionHandlerSS.ConnectToDatabase("SecuritySymbol");
     _connectionHandlerLU.ConnectToDatabase("LastUpdate");
 }
Esempio n. 9
0
 public ObtainGoodInvestments(ILogger <ObtainGoodInvestments> logger,
                              IDBConnectionHandler <PiotroskiScoreMd> connectionHandlerCF,
                              ResolveCompanyName resolveCompanyName,
                              ObtainStockQuote obtainStockQuote,
                              EnvHandler envHandler)
 {
     _logger = logger;
     _connectionHandlerCF = connectionHandlerCF;
     _envHandler          = envHandler;
     _resolveCompanyName  = resolveCompanyName;
     _obtainStockQuote    = obtainStockQuote;
     _ = _connectionHandlerCF.ConnectToDatabase("PiotroskiScore");
 }
Esempio n. 10
0
        private static void ConfigureServices(ServiceCollection serviceCollection)
        {
            SetApplicationEnvVar.SetEnvVariablesFromS3();

            var mongoURL = EnvHandler.GetApiKey("InvestDb");

            serviceCollection.AddScoped <IAppRepository <string> >(r => new Repository <string>(mongoURL));

            serviceCollection.AddAutoMapper(typeof(AMProfile));
            MapperConfiguration config = new MapperConfiguration(cfg =>
            {
                cfg.AddProfile <AMProfile>();
            });

            config.AssertConfigurationIsValid();
            serviceCollection.AddSingleton <IReadSCFile, ReadSCFile>();
        }
        public EvaluateSecurity(
            ILogger <EvaluateSecurity> logger,
            IMapper mapper,
            IAppRepository <string> appRepository,
            IHttpClientFactory clientFactory)
        {
            this.logger        = logger;
            this.mapper        = mapper;
            this.appRepository = appRepository;

            //HttpClient
            client  = clientFactory.CreateClient();
            client1 = clientFactory.CreateClient();

            //API Gateway key
            IsrKey       = EnvHandler.GetApiKey(@"ISRApiHandler");
            simFinAPIKey = EnvHandler.GetApiKey(@"SimFinKey");
        }
Esempio n. 12
0
        private void ConfigureServices(IServiceCollection serviceCollection)
        {
            SetApplicationEnvVar.SetEnvVariablesFromS3();
            var mongoURL = EnvHandler.GetApiKey("InvestDb");

            serviceCollection.AddScoped <IAppRepository <string> >(r => new Repository <string>(mongoURL));

            serviceCollection.AddAutoMapper(typeof(AMProfile));
            MapperConfiguration config = new MapperConfiguration(cfg =>
            {
                cfg.AddProfile <AMProfile>();
            });

            config.AssertConfigurationIsValid();
            serviceCollection.AddLogging(c => c.AddNLog())
            .Configure <LoggerFilterOptions>(o => o.MinLevel = LogLevel.Debug)
            .AddTransient(typeof(ILogger <>), typeof(Logger <>));
            serviceCollection.AddScoped <IPopulateSQS, PopulateSQS>();
            serviceCollection.AddScoped <ISecurityPriceSave, SecurityPriceSave>();
            serviceCollection.AddScoped <IEvaluateSecurity, EvaluateSecurity>();
            serviceCollection.AddHttpClient();
        }
Esempio n. 13
0
 public ObtainStockQuote(ILogger <ObtainStockQuote> log, ObtainCompanyDetails obtainCompanyDetails, EnvHandler envHandler)
 {
     _log = log;
     _obtainCompanyDetails = obtainCompanyDetails;
     _envHandler           = envHandler;
 }
Esempio n. 14
0
 public ObtainCompanyDetails(ILogger <ObtainCompanyDetails> log, EnvHandler envHandler)
 {
     _log        = log;
     _envHandler = envHandler;
 }
Esempio n. 15
0
 public ObtainMarketSummary(ILogger <ObtainMarketSummary> log, EnvHandler envHandler)
 {
     _log        = log;
     _envHandler = envHandler;
 }
Esempio n. 16
0
 public ObtainNews(ILogger <ObtainNews> log, EnvHandler envHandler)
 {
     _log        = log;
     _envHandler = envHandler;
 }
Esempio n. 17
0
 /// <summary>
 /// Initializes a new instance of the <see cref="ObtainStockQuote"/> class.
 /// </summary>
 /// <param name="logger">The logger.</param>
 /// <param name="resolveCompanyName">Name of the resolve company.</param>
 /// <param name="envHandler">The env handler.</param>
 public ObtainStockQuote(ILogger <ObtainStockQuote> logger, ResolveCompanyName resolveCompanyName, EnvHandler envHandler)
 {
     _logger             = logger;
     _envHandler         = envHandler;
     _resolveCompanyName = resolveCompanyName;
 }