public ISourceFilingsListResult GetFilingsList(ISourceValidateParams vldParams)
        {
            SECSourceFilingsListResult result = new SECSourceFilingsListResult();

            SECSourceValidateParams vldSECParams = vldParams as SECSourceValidateParams;

            if (vldSECParams != null)
            {
                string cik = _dictionary.LookupRegulatorCompanyCode(vldParams.RegulatorCode, vldParams.CompanyCode);
                if (!string.IsNullOrEmpty(cik))
                {
                    Submissions submissions = _secApi.ArchivesEdgarDataCIK(cik);

                    foreach (var filing in submissions.Folders.OrderBy(x => x.LastModified).Where(x => x.LastModified >= vldSECParams.UpdateFromDate && x.LastModified <= vldSECParams.UpdateToDate))
                    {
                        SECSourceItemInfo secSourceItemInfo = new SECSourceItemInfo();
                        secSourceItemInfo.Name = filing.Name;
                        result.Filings.Add(secSourceItemInfo);
                    }

                    result.Success = true;
                }
                else
                {
                    result.Success = false;
                    result.AddError(EErrorCodes.InvalidParserParams, EErrorType.Error, string.Format("Cannot find the SEC CIK for company with code {0}", vldParams.CompanyCode));
                }
            }

            return(result);
        }
Exemple #2
0
        public void SubmissionsByCIK_Success()
        {
            SECApi api = new SECApi();

            string cik = ConfigurationManager.AppSettings["SEC_CIK_AAPL"];

            Submissions submissions = api.ArchivesEdgarDataCIK(cik);

            Assert.AreNotEqual(submissions, null, "Submissions are NULL");
            Assert.AreEqual(submissions.CIK, cik, "Invalid CIK returned");
            Assert.IsTrue(submissions.Folders.Count > 0, "List of folders is EMPTY");
        }
Exemple #3
0
        public void SubmissionsByCIK_Success()
        {
            SECApi api = new SECApi();

            IConfiguration config = GetConfiguration();

            string cik = config.GetValue(typeof(string), "SEC_CIK_AAPL").ToString();

            Submissions submissions = api.ArchivesEdgarDataCIK(cik);

            Assert.AreNotEqual(submissions, null, "Submissions are NULL");
            Assert.AreEqual(submissions.CIK, cik, "Invalid CIK returned");
            Assert.IsTrue(submissions.Folders.Count > 0, "List of folders is EMPTY");
        }