diff --git a/IEXSharp/Model/CoreData/StockFundamentals/Response/ReportedFinancialResponse.cs b/IEXSharp/Model/CoreData/StockFundamentals/Response/ReportedFinancialResponse.cs new file mode 100644 index 0000000..6ca3ee6 --- /dev/null +++ b/IEXSharp/Model/CoreData/StockFundamentals/Response/ReportedFinancialResponse.cs @@ -0,0 +1,272 @@ +namespace IEXSharp.Model.CoreData.StockFundamentals.Response +{ + public class ReportedFinancialResponse + { + public string id { get; set; } + public string source { get; set; } + public string key { get; set; } + public string subkey { get; set; } + public long date { get; set; } + public long updated { get; set; } + public long DecreaseInUnrecognizedTaxBenefitsIsReasonablyPossible { get; set; } + public long? formFiscalYear { get; set; } + public string version { get; set; } + public long periodStart { get; set; } + public long periodEnd { get; set; } + public long dateFiled { get; set; } + public long? formFiscalQuarter { get; set; } + public string reportLink { get; set; } + public long OtherAccruedLiabilitiesCurrent { get; set; } + public long OtherAssetsCurrent { get; set; } + public long DeferredFederalStateAndLocalTaxExpenseBenefit { get; set; } + public long OtherAssetsNoncurrent { get; set; } + public long DeferredForeignIncomeTaxExpenseBenefit { get; set; } + public long DeferredIncomeTaxAssetsNet { get; set; } + public long DeferredIncomeTaxesAndTaxCredits { get; set; } + public long DeferredIncomeTaxExpenseBenefit { get; set; } + public long DeferredIncomeTaxLiabilities { get; set; } + public long DeferredIncomeTaxLiabilitiesNet { get; set; } + public long OtherComprehensiveIncomeLossAvailableForSaleSecuritiesAdjustmentNetOfTax { get; set; } + public long OtherComprehensiveIncomeLossAvailableForSaleSecuritiesTax { get; set; } + public long OtherComprehensiveIncomeLossCashFlowHedgeGainLossAfterReclassificationAndTax { get; set; } + public long OtherComprehensiveIncomeLossCashFlowHedgeGainLossAfterReclassificationTax { get; set; } + public long OtherComprehensiveIncomeLossCashFlowHedgeGainLossBeforeReclassificationAfterTax { get; set; } + public long OtherComprehensiveIncomeLossCashFlowHedgeGainLossReclassificationAfterTax { get; set; } + public long DeferredTaxAssetsGross { get; set; } + public long DeferredTaxAssetsLiabilitiesNet { get; set; } + public long DeferredTaxAssetsNet { get; set; } + public long DeferredTaxAssetsOperatingLossCarryforwards { get; set; } + public long DeferredTaxAssetsOther { get; set; } + public long OtherComprehensiveIncomeLossForeignCurrencyTransactionAndTranslationAdjustmentNetOfTax { get; set; } + public long OtherComprehensiveIncomeLossNetOfTax { get; set; } + public long OtherComprehensiveIncomeLossNetOfTaxPortionAttributableToParent { get; set; } + public long OtherComprehensiveIncomeLossReclassificationAdjustmentFromAOCIForSaleOfSecuritiesNetOfTax { get; set; } + public long DeferredTaxAssetsTaxCreditCarryforwardsOther { get; set; } + public long DeferredTaxAssetsTaxDeferredExpenseCompensationAndBenefitsEmployeeBenefits { get; set; } + public long DeferredTaxAssetsTaxDeferredExpenseCompensationAndBenefitsShareBasedCompensationCost { get; set; } + public long DeferredTaxAssetsTaxDeferredExpenseReservesAndAccrualsOther { get; set; } + public long DeferredTaxAssetsValuationAllowance { get; set; } + public long DeferredTaxLiabilities { get; set; } + public long DeferredTaxLiabilitiesGoodwillAndlongangibleAssetslongangibleAssets { get; set; } + public long DeferredTaxLiabilitiesInvestments { get; set; } + public long DeferredTaxLiabilitiesOther { get; set; } + public long DeferredTaxLiabilitiesPropertyPlantAndEquipment { get; set; } + public long LossContingencyAccrualCarryingValueCurrent { get; set; } + public long DefinedContributionPlanCostRecognized { get; set; } + public long InventoryNet { get; set; } + public long EmployeeRelatedLiabilitiesCurrent { get; set; } + public long LossContingencyLossInPeriod { get; set; } + public long IncreaseDecreaseInIncomeTaxes { get; set; } + public long ForeignCurrencyCashFlowHedgeGainLossToBeReclassifiedDuringNext12Months { get; set; } + public long AccountsPayableCurrent { get; set; } + public long IncreaseDecreaseInOtherOperatingAssets { get; set; } + public long OtherComprehensiveIncomeUnrealizedHoldingGainLossOnSecuritiesArisingDuringPeriodNetOfTax { get; set; } + public long EmployeeServiceShareBasedCompensationTaxBenefitFromCompensationExpense { get; set; } + public long ForeignCurrencyTransactionGainLossBeforeTax { get; set; } + public long ForeignCurrencyTransactionLossBeforeTax { get; set; } + public long AccountsReceivableNetCurrent { get; set; } + public long ContractWithCustomerLiabilityCurrent { get; set; } + public long ContractWithCustomerLiabilityNoncurrent { get; set; } + public long ContractWithCustomerLiabilityRevenueRecognized { get; set; } + public long Assets { get; set; } + public long AssetsCurrent { get; set; } + public long ImpairmentOfInvestments { get; set; } + public long IncomeLossFromContinuingOperationsBeforeIncomeTaxesDomestic { get; set; } + public long IncomeLossFromContinuingOperationsBeforeIncomeTaxesForeign { get; set; } + public long IncomeLossFromContinuingOperationsBeforeIncomeTaxesMinoritylongerestAndIncomeLossFromEquityMethodInvestments { get; set; } + public long IncomeTaxesPaidNet { get; set; } + public long IncomeTaxesReceivable { get; set; } + public long IncomeTaxExpenseBenefit { get; set; } + public long CommercialPaper { get; set; } + public long CommitmentsAndContingencies { get; set; } + public long MarketableSecuritiesCurrent { get; set; } + public long CommonStockCapitalSharesReservedForFutureIssuance { get; set; } + public long MarketingAndAdvertisingExpense { get; set; } + public double PreferredStockParOrStatedValuePerShare { get; set; } + public long PreferredStockSharesAuthorized { get; set; } + public long PreferredStockSharesIssued { get; set; } + public long PreferredStockSharesOutstanding { get; set; } + public long DerivativeAssetFairValueGrossLiability { get; set; } + public long DerivativeAssetFairValueOffsetAgainstCollateralNetOfNotSubjectToMasterNettingArrangementPolicyElection { get; set; } + public long AssetsNoncurrent { get; set; } + public double CommonStockParOrStatedValuePerShare { get; set; } + public long CommonStockSharesAuthorized { get; set; } + public long CommonStockSharesIssued { get; set; } + public long CommonStockSharesOutstanding { get; set; } + public long CommonStocksIncludingAdditionalPaidInCapital { get; set; } + public long AccruedIncomeTaxesCurrent { get; set; } + public long AccruedIncomeTaxesNoncurrent { get; set; } + public long AccruedLiabilitiesCurrent { get; set; } + public long IncreaseDecreaseInAccountsPayable { get; set; } + public long IncreaseDecreaseInAccountsReceivable { get; set; } + public long IncreaseDecreaseInAccruedLiabilities { get; set; } + public long ConvertiblePreferredStockNonredeemableOrRedeemableIssuerOptionValue { get; set; } + public long LongTermDebt { get; set; } + public long LongTermDebtAndCapitalLeaseObligations { get; set; } + public long ComprehensiveIncomeNetOfTax { get; set; } + public long LongTermDebtFairValue { get; set; } + public long LongTermDebtMaturitiesRepaymentsOfPrincipalAfterYearFive { get; set; } + public long LongTermDebtMaturitiesRepaymentsOfPrincipalInNextTwelveMonths { get; set; } + public long NetCashProvidedByUsedInFinancingActivities { get; set; } + public long NetCashProvidedByUsedInInvestingActivities { get; set; } + public long NetCashProvidedByUsedInOperatingActivities { get; set; } + public long DerivativeAssetNotOffsetPolicyElectionDeduction { get; set; } + public long DerivativeAssets { get; set; } + public long EntityPublicFloat { get; set; } + public long NetIncomeLoss { get; set; } + public long IncreaseDecreaseInCollateralHeldUnderSecuritiesLending { get; set; } + public long IncreaseDecreaseInContractWithCustomerLiability { get; set; } + public long DerivativeCollateralObligationToReturnCash { get; set; } + public long DerivativeCollateralObligationToReturnSecurities { get; set; } + public long DerivativeCollateralRightToReclaimCash { get; set; } + public long DerivativeCollateralRightToReclaimSecurities { get; set; } + public long AccumulatedDepreciationDepletionAndAmortizationPropertyPlantAndEquipment { get; set; } + public long PaymentsForRepurchaseOfCommonStock { get; set; } + public long LeaseAndRentalExpense { get; set; } + public long LongTermDebtMaturitiesRepaymentsOfPrincipalInYearFive { get; set; } + public long LongTermDebtMaturitiesRepaymentsOfPrincipalInYearFour { get; set; } + public long LongTermDebtMaturitiesRepaymentsOfPrincipalInYearThree { get; set; } + public long LongTermDebtMaturitiesRepaymentsOfPrincipalInYearTwo { get; set; } + public long LongTermDebtNoncurrent { get; set; } + public long DerivativeFairValueOfDerivativeAsset { get; set; } + public long DerivativeFairValueOfDerivativeLiability { get; set; } + public long AvailableForSaleDebtSecuritiesAccumulatedGrossUnrealizedGainBeforeTax { get; set; } + public long AvailableForSaleDebtSecuritiesAccumulatedGrossUnrealizedLossBeforeTax { get; set; } + public long AccumulatedOtherComprehensiveIncomeLossNetOfTax { get; set; } + public long ProceedsFromCollectionOfNotesReceivable { get; set; } + public long ProceedsFromDebtNetOfIssuanceCosts { get; set; } + public long longangibleAssetsNetExcludingGoodwill { get; set; } + public long UnrecognizedTaxBenefits { get; set; } + public long UnrecognizedTaxBenefitsDecreasesResultingFromPriorPeriodTaxPositions { get; set; } + public long UnrecognizedTaxBenefitsDecreasesResultingFromSettlementsWithTaxingAuthorities { get; set; } + public long UnrecognizedTaxBenefitsIncomeTaxPenaltiesAndlongerestAccrued { get; set; } + public long UnrecognizedTaxBenefitsIncreasesResultingFromCurrentPeriodTaxPositions { get; set; } + public long UnrecognizedTaxBenefitsIncreasesResultingFromPriorPeriodTaxPositions { get; set; } + public long AvailableForSaleSecuritiesDebtMaturitiesAfterFiveThroughTenYearsFairValue { get; set; } + public long AvailableForSaleSecuritiesDebtMaturitiesAfterOneThroughFiveYearsFairValue { get; set; } + public long AvailableForSaleSecuritiesDebtMaturitiesAfterTenYearsFairValue { get; set; } + public long EquityMethodInvestments { get; set; } + public long CapitalLeasedAssetsGross { get; set; } + public long CapitalLeaseObligationsNoncurrent { get; set; } + public long ProceedsFromMinorityShareholders { get; set; } + public long ProceedsFromPaymentsForSecuritiesPurchasedUnderAgreementsToResell { get; set; } + public long DerivativeLiabilities { get; set; } + public long DerivativeLiabilityFairValueGrossAsset { get; set; } + public long DerivativeLiabilityFairValueOffsetAgainstCollateralNetOfNotSubjectToMasterNettingArrangementPolicyElection { get; set; } + public long DerivativeLiabilityNotOffsetPolicyElectionDeduction { get; set; } + public long EquitySecuritiesFvNiGainLoss { get; set; } + public long EquitySecuritiesFvNiRealizedGainLoss { get; set; } + public long EquitySecuritiesFvNiUnrealizedGainLoss { get; set; } + public long AvailableForSaleSecuritiesDebtMaturitiesWithinOneYearFairValue { get; set; } + public long AvailableForSaleSecuritiesDebtSecurities { get; set; } + public long ProceedsFromSaleAndMaturityOfMarketableSecurities { get; set; } + public long ProceedsFromSaleAndMaturityOfOtherInvestments { get; set; } + public long PaymentsToAcquireMarketableSecurities { get; set; } + public long PaymentsToAcquireOtherInvestments { get; set; } + public long PaymentsToAcquirePropertyPlantAndEquipment { get; set; } + public long EquitySecuritiesWithoutReadilyDeterminableFairValueAmount { get; set; } + public long EquitySecuritiesWithoutReadilyDeterminableFairValueDownwardPriceAdjustmentAnnualAmount { get; set; } + public long EquitySecuritiesWithoutReadilyDeterminableFairValueDownwardPriceAdjustmentCumulativeAmount { get; set; } + public long EquitySecuritiesWithoutReadilyDeterminableFairValueUpwardPriceAdjustmentAnnualAmount { get; set; } + public long EquitySecuritiesWithoutReadilyDeterminableFairValueUpwardPriceAdjustmentCumulativeAmount { get; set; } + public long CashAndCashEquivalentsAtCarryingValue { get; set; } + public long CashAndCashEquivalentsFairValueDisclosure { get; set; } + public long CashAndCashEquivalentsPeriodIncreaseDecrease { get; set; } + public long CashCashEquivalentsAndShortTermInvestments { get; set; } + public long PurchaseObligation { get; set; } + public long AdjustmentsToAdditionalPaidInCapitalSharebasedCompensationRequisiteServicePeriodRecognitionValue { get; set; } + public long NoncontrollinglongerestIncreaseFromSaleOfParentEquitylongerest { get; set; } + public long Liabilities { get; set; } + public long LiabilitiesAndStockholdersEquity { get; set; } + public long LiabilitiesCurrent { get; set; } + public long ProceedsFromSaleOfPropertyPlantAndEquipment { get; set; } + public long longerestCostsCapitalized { get; set; } + public long longerestExpense { get; set; } + public long GeneralAndAdministrativeExpense { get; set; } + public long PropertyPlantAndEquipmentGross { get; set; } + public long PropertyPlantAndEquipmentNet { get; set; } + public long AllocatedShareBasedCompensationExpense { get; set; } + public long CostMethodInvestments { get; set; } + public long CostMethodInvestmentsFairValueDisclosure { get; set; } + public long longerestIncomeOther { get; set; } + public long longerestPaidNet { get; set; } + public long SellingAndMarketingExpense { get; set; } + public long Goodwill { get; set; } + public long GoodwillAcquiredDuringPeriod { get; set; } + public long AllowanceForDoubtfulAccountsReceivableCurrent { get; set; } + public long NonoperatingIncomeExpense { get; set; } + public long StockholdersEquity { get; set; } + public long GoodwillImpairmentLoss { get; set; } + public long GoodwillTransfers { get; set; } + public long GoodwillTranslationAndPurchaseAccountingAdjustments { get; set; } + public long FiniteLivedlongangibleAssetsAccumulatedAmortization { get; set; } + public long FiniteLivedlongangibleAssetsAmortizationExpenseAfterYearFive { get; set; } + public long FiniteLivedlongangibleAssetsAmortizationExpenseNextTwelveMonths { get; set; } + public long FiniteLivedlongangibleAssetsAmortizationExpenseYearFive { get; set; } + public long FiniteLivedlongangibleAssetsAmortizationExpenseYearFour { get; set; } + public long FiniteLivedlongangibleAssetsAmortizationExpenseYearThree { get; set; } + public long FiniteLivedlongangibleAssetsAmortizationExpenseYearTwo { get; set; } + public long FiniteLivedlongangibleAssetsGross { get; set; } + public long FiniteLivedlongangibleAssetsNet { get; set; } + public double EarningsPerShareBasic { get; set; } + public double EarningsPerShareDiluted { get; set; } + public long RevenueFromContractWithCustomerExcludingAssessedTax { get; set; } + public long OciBeforeReclassificationsNetOfTaxAttributableToParent { get; set; } + public double EffectiveIncomeTaxRateContinuingOperations { get; set; } + public double EffectiveIncomeTaxRateReconciliationAtFederalStatutoryIncomeTaxRate { get; set; } + public double EffectiveIncomeTaxRateReconciliationChangeInDeferredTaxAssetsValuationAllowance { get; set; } + public double EffectiveIncomeTaxRateReconciliationChangeInEnactedTaxRate { get; set; } + public double EffectiveIncomeTaxRateReconciliationForeignIncomeTaxRateDifferential { get; set; } + public long CostOfRevenue { get; set; } + public double EffectiveIncomeTaxRateReconciliationNondeductibleExpenseShareBasedCompensationCost { get; set; } + public double EffectiveIncomeTaxRateReconciliationOtherAdjustments { get; set; } + public double EffectiveIncomeTaxRateReconciliationTaxCreditsResearch { get; set; } + public long RetainedEarningsAccumulatedDeficit { get; set; } + public long CostsAndExpenses { get; set; } + public long RepaymentsOfDebtAndCapitalLeaseObligations { get; set; } + public long EffectOfExchangeRateOnCashAndCashEquivalents { get; set; } + public long CumulativeEffectOfNewAccountingPrincipleInPeriodOfAdoption { get; set; } + public long CurrentFederalStateAndLocalTaxExpenseBenefit { get; set; } + public long OperatingIncomeLoss { get; set; } + public long UnrecognizedTaxBenefitsThatWouldImpactEffectiveTaxRate { get; set; } + public long StockIssuedDuringPeriodValueNewIssues { get; set; } + public long StockRepurchasedAndRetiredDuringPeriodValue { get; set; } + public long CurrentForeignTaxExpenseBenefit { get; set; } + public long CurrentIncomeTaxExpenseBenefit { get; set; } + public long OperatingLeasesFutureMinimumPaymentsDue { get; set; } + public long OperatingLeasesFutureMinimumPaymentsDueCurrent { get; set; } + public long OperatingLeasesFutureMinimumPaymentsDueInFiveYears { get; set; } + public long OperatingLeasesFutureMinimumPaymentsDueInFourYears { get; set; } + public long OperatingLeasesFutureMinimumPaymentsDuelonghreeYears { get; set; } + public long OperatingLeasesFutureMinimumPaymentsDuelongwoYears { get; set; } + public long OperatingLeasesFutureMinimumPaymentsDueThereafter { get; set; } + public long OperatingLeasesFutureMinimumPaymentsReceivable { get; set; } + public long OperatingLeasesFutureMinimumPaymentsReceivableCurrent { get; set; } + public long OperatingLeasesFutureMinimumPaymentsReceivableInFiveYears { get; set; } + public long OperatingLeasesFutureMinimumPaymentsReceivableInFourYears { get; set; } + public long OperatingLeasesFutureMinimumPaymentsReceivablelonghreeYears { get; set; } + public long OperatingLeasesFutureMinimumPaymentsReceivablelongwoYears { get; set; } + public long OperatingLeasesFutureMinimumPaymentsReceivableThereafter { get; set; } + public long DebtAndEquitySecuritiesGainLoss { get; set; } + public long VariablelongerestEntityConsolidatedAssetsPledged { get; set; } + public long VariablelongerestEntityConsolidatedLiabilitiesNoRecourse { get; set; } + public long ResearchAndDevelopmentExpense { get; set; } + public long DebtInstrumentUnamortizedDiscount { get; set; } + public long DebtSecuritiesAvailableForSaleRealizedLoss { get; set; } + public long DebtSecuritiesAvailableForSaleUnrealizedLossPosition { get; set; } + public long DebtSecuritiesAvailableForSaleUnrealizedLossPositionAccumulatedLoss { get; set; } + public long DebtSecuritiesAvailableForSaleContinuousUnrealizedLossPositionLessThan12MonthsAccumulatedLoss { get; set; } + public long DebtSecuritiesAvailableForSaleContinuousUnrealizedLossPositionLessThan12Months { get; set; } + public long DebtSecuritiesAvailableForSaleContinuousUnrealizedLossPosition12MonthsOrLongerAccumulatedLoss { get; set; } + public long DebtSecuritiesAvailableForSaleContinuousUnrealizedLossPosition12MonthsOrLonger { get; set; } + public long DebtSecuritiesAvailableForSaleRealizedGain { get; set; } + public long DebtSecuritiesRealizedGainLoss { get; set; } + public long ShareBasedCompensation { get; set; } + public long TaxCreditCarryforwardAmount { get; set; } + public long OtherLiabilitiesNoncurrent { get; set; } + public long OtherLongTermInvestments { get; set; } + public long OtherNoncashIncomeExpense { get; set; } + public long OtherNonoperatingIncomeExpense { get; set; } + public long ReclassificationFromAociCurrentPeriodNetOfTaxAttributableToParent { get; set; } + } +} \ No newline at end of file diff --git a/IEXSharp/Model/Shared/Request/Filing.cs b/IEXSharp/Model/Shared/Request/Filing.cs new file mode 100644 index 0000000..47da0d3 --- /dev/null +++ b/IEXSharp/Model/Shared/Request/Filing.cs @@ -0,0 +1,12 @@ +using System.ComponentModel; + +namespace IEXSharp.Model.Shared.Request +{ + public enum Filing + { + [Description("10-K")] + Annual, + [Description("10-Q")] + Quarterly + } +} \ No newline at end of file diff --git a/IEXSharp/Model/Shared/Request/TimeSeries.cs b/IEXSharp/Model/Shared/Request/TimeSeries.cs index c1777e0..29d1f71 100644 --- a/IEXSharp/Model/Shared/Request/TimeSeries.cs +++ b/IEXSharp/Model/Shared/Request/TimeSeries.cs @@ -1,5 +1,4 @@ using System; -using Common.Logging.Configuration; using IEXSharp.Helper; namespace IEXSharp.Model.Shared.Request @@ -36,22 +35,32 @@ public TimeSeries SetDateRange(DateTime? from, DateTime? to = default) return this; } - public NameValueCollection TimeSeriesQueryParams() + public TimeSeries SetLast(int last) { - var nvc = new NameValueCollection(); + Last = last; + return this; + } + + /// + /// Updates give query string builder class with required Time series query params + /// + /// + public void AddTimeSeriesQueryParams(QueryStringBuilder qsb) + { + if (qsb == null) return; if (From != null) { - nvc.Add("from", From); - nvc.Add("to", To); + qsb.Add("from", From); + qsb.Add("to", To); } if (!string.IsNullOrEmpty(Range) && string.IsNullOrEmpty(From)) { - nvc.Add("range", Range); + qsb.Add("range", Range); } - return nvc; + if (Last > 0) qsb.Add("last", Last.ToString()); } } } \ No newline at end of file diff --git a/IEXSharp/Model/Shared/Response/Financial.cs b/IEXSharp/Model/Shared/Response/Financial.cs index 9ea0389..1559e9b 100644 --- a/IEXSharp/Model/Shared/Response/Financial.cs +++ b/IEXSharp/Model/Shared/Response/Financial.cs @@ -1,4 +1,4 @@ -using System; +using System; namespace IEXSharp.Model.Shared.Response { diff --git a/IEXSharp/Service/Cloud/CoreData/StockFundamentals/IStockFundamentalsService.cs b/IEXSharp/Service/Cloud/CoreData/StockFundamentals/IStockFundamentalsService.cs index aedc79f..65a64b7 100644 --- a/IEXSharp/Service/Cloud/CoreData/StockFundamentals/IStockFundamentalsService.cs +++ b/IEXSharp/Service/Cloud/CoreData/StockFundamentals/IStockFundamentalsService.cs @@ -101,6 +101,16 @@ public interface IStockFundamentalsService /// Task> FinancialAsync(string symbol, int last = 1); + /// + /// + /// As reported financials are pulled directly from the raw SEC filings. Returns raw financial data reported in 10-K and 10-Q filings + /// + /// + /// + /// + /// + Task>> ReportedFinancialsAsync(string symbol, Filing filing = Filing.Quarterly, TimeSeries timeSeries = null); + /// /// /// Financial Firms report financials in a different format than our 3rd party processes therefore our data is limited diff --git a/IEXSharp/Service/Cloud/CoreData/StockFundamentals/StockFundamentalsService.cs b/IEXSharp/Service/Cloud/CoreData/StockFundamentals/StockFundamentalsService.cs index ab5dc4e..023b5b4 100644 --- a/IEXSharp/Service/Cloud/CoreData/StockFundamentals/StockFundamentalsService.cs +++ b/IEXSharp/Service/Cloud/CoreData/StockFundamentals/StockFundamentalsService.cs @@ -24,14 +24,7 @@ public async Task>> Advanc var qsb = new QueryStringBuilder(); - if (timeSeries != null) - { - var queryParams = timeSeries.TimeSeriesQueryParams(); - foreach (var nameValue in queryParams) - { - qsb.Add(nameValue.Key, nameValue.Value); - } - } + timeSeries?.AddTimeSeriesQueryParams(qsb); var pathNvc = new NameValueCollection { @@ -119,6 +112,23 @@ public async Task> EarningFieldAsync(string symbol, string f public async Task> FinancialAsync(string symbol, int last = 1) => await executor.SymbolLastExecuteAsync("stock/[symbol]/financials/[last]", symbol, last); + public async Task>> ReportedFinancialsAsync(string symbol, Filing filing = Filing.Quarterly, TimeSeries timeSeries = null) + { + const string urlPattern = "time-series/reported_financials/[symbol]/[filing]"; + + var qsb = new QueryStringBuilder(); + + timeSeries?.AddTimeSeriesQueryParams(qsb); + + var pathNvc = new NameValueCollection + { + {"symbol", symbol}, + {"filing", filing.GetDescriptionFromEnum()} + }; + + return await executor.ExecuteAsync>(urlPattern, pathNvc, qsb); + } + public async Task> FinancialFieldAsync(string symbol, string field, int last = 1) => await executor.SymbolLastFieldExecuteAsync("stock/[symbol]/financials/[last]/[field]", symbol, field, last); diff --git a/IEXSharpTest/Cloud/CoreData/StockFundamentalsTest.cs b/IEXSharpTest/Cloud/CoreData/StockFundamentalsTest.cs index 84e126c..440bca9 100644 --- a/IEXSharpTest/Cloud/CoreData/StockFundamentalsTest.cs +++ b/IEXSharpTest/Cloud/CoreData/StockFundamentalsTest.cs @@ -1,4 +1,5 @@ using System; +using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; using IEXSharp; @@ -161,6 +162,30 @@ public async Task FinancialAsyncTest(string symbol, int last) Assert.GreaterOrEqual(response.Data.financials.Count, 1); } + public static List ReportedFinancialsTestCaseSourceData() + { + return new List{ + new TestCaseData("AAPL", Filing.Quarterly, null), + new TestCaseData("AAPL", Filing.Quarterly, new TimeSeries(TimeSeriesPeriod.Quarterly).SetLast(2)), + new TestCaseData("AAPL", Filing.Quarterly, new TimeSeries(TimeSeriesPeriod.Annual).SetLast(2)), + new TestCaseData("AAPL", Filing.Quarterly, new TimeSeries(TimeSeriesPeriod.Quarterly).SetDateRange(new DateTime(2019,1,1), new DateTime(2021,1,1))) + }; + } + + [Test] + [TestCaseSource("ReportedFinancialsTestCaseSourceData")] + public async Task ReportedFinancialsTest(string symbol, Filing filing, TimeSeries timeSeries = null) + { + var response = await sandBoxClient.StockFundamentals.ReportedFinancialsAsync(symbol, filing, timeSeries); + + Assert.IsNull(response.ErrorMessage); + foreach (var data in response.Data) + { + Assert.IsNotNull(data); + Assert.IsNotNull(data.AccountsPayableCurrent); + } + } + [Test] [TestCase("AAPL", "grossProfit", 1)] [TestCase("FB", "grossProfit", 2)]