Skip to content

Commit

Permalink
fix(quoteSummary): iface fixes, TopHoldings
Browse files Browse the repository at this point in the history
  • Loading branch information
gadicc committed Feb 3, 2021
1 parent eae40e2 commit 904934a
Show file tree
Hide file tree
Showing 2 changed files with 226 additions and 10 deletions.
175 changes: 170 additions & 5 deletions schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -294,9 +294,6 @@
"otherLiab",
"totalCurrentLiabilities",
"totalLiab",
"retainedEarnings",
"treasuryStock",
"otherStockholderEquity",
"totalStockholderEquity",
"netTangibleAssets"
],
Expand All @@ -306,13 +303,13 @@
"additionalProperties": false,
"properties": {
"dividendDate": {
"yahooFinanceType": "number"
"yahooFinanceType": "date"
},
"earnings": {
"$ref": "#/definitions/CalendarEventsEarnings"
},
"exDividendDate": {
"yahooFinanceType": "number"
"yahooFinanceType": "date"
},
"maxAge": {
"yahooFinanceType": "number"
Expand Down Expand Up @@ -1948,6 +1945,9 @@
"summaryProfile": {
"$ref": "#/definitions/SummaryProfile"
},
"topHoldings": {
"$ref": "#/definitions/TopHoldings"
},
"upgradeDowngradeHistory": {
"$ref": "#/definitions/UpgradeDowngradeHistory"
}
Expand Down Expand Up @@ -2705,6 +2705,171 @@
],
"type": "object"
},
"TopHoldings": {
"additionalProperties": false,
"properties": {
"bondHoldings": {
"type": "object"
},
"bondPosition": {
"yahooFinanceType": "number"
},
"bondRatings": {
"items": {
"$ref": "#/definitions/TopHoldingsBondRating"
},
"type": "array"
},
"equityHoldings": {
"$ref": "#/definitions/TopHoldingsEquityHoldings"
},
"holdings": {
"items": {
"$ref": "#/definitions/TopHoldingsHolding"
},
"type": "array"
},
"maxAge": {
"yahooFinanceType": "number"
},
"sectorWeightings": {
"items": {
"$ref": "#/definitions/TopHoldingsSectorWeighting"
},
"type": "array"
},
"stockPosition": {
"yahooFinanceType": "number"
}
},
"required": [
"maxAge",
"stockPosition",
"bondPosition",
"holdings",
"equityHoldings",
"bondHoldings",
"bondRatings",
"sectorWeightings"
],
"type": "object"
},
"TopHoldingsBondRating": {
"additionalProperties": false,
"properties": {
"a": {
"yahooFinanceType": "number"
},
"aa": {
"yahooFinanceType": "number"
},
"aaa": {
"yahooFinanceType": "number"
},
"b": {
"yahooFinanceType": "number"
},
"bb": {
"yahooFinanceType": "number"
},
"bbb": {
"yahooFinanceType": "number"
},
"below_b": {
"yahooFinanceType": "number"
},
"other": {
"yahooFinanceType": "number"
},
"us_government": {
"yahooFinanceType": "number"
}
},
"type": "object"
},
"TopHoldingsEquityHoldings": {
"additionalProperties": false,
"properties": {
"priceToBook": {
"yahooFinanceType": "number"
},
"priceToCashflow": {
"yahooFinanceType": "number"
},
"priceToEarnings": {
"yahooFinanceType": "number"
},
"priceToSales": {
"yahooFinanceType": "number"
}
},
"required": [
"priceToEarnings",
"priceToBook",
"priceToSales",
"priceToCashflow"
],
"type": "object"
},
"TopHoldingsHolding": {
"additionalProperties": false,
"properties": {
"holdingName": {
"type": "string"
},
"holdingPercent": {
"yahooFinanceType": "number"
},
"symbol": {
"type": "string"
}
},
"required": [
"symbol",
"holdingName",
"holdingPercent"
],
"type": "object"
},
"TopHoldingsSectorWeighting": {
"additionalProperties": false,
"properties": {
"basic_materials": {
"yahooFinanceType": "number"
},
"communication_services": {
"yahooFinanceType": "number"
},
"consumer_cyclical": {
"yahooFinanceType": "number"
},
"consumer_defensive": {
"yahooFinanceType": "number"
},
"energy": {
"yahooFinanceType": "number"
},
"financial_services": {
"yahooFinanceType": "number"
},
"healthcare": {
"yahooFinanceType": "number"
},
"industrials": {
"yahooFinanceType": "number"
},
"realestate": {
"yahooFinanceType": "number"
},
"technology": {
"yahooFinanceType": "number"
},
"utilities": {
"yahooFinanceType": "number"
}
},
"type": "object"
},
"Transaction": {
"additionalProperties": false,
"properties": {
Expand Down
61 changes: 56 additions & 5 deletions src/modules/quoteSummary-iface.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ export interface QuoteSummaryResult {
sectorTrend?: Trend;
summaryDetail?: SummaryDetail;
summaryProfile?: SummaryProfile;
topHoldings?: TopHoldings;
upgradeDowngradeHistory?: UpgradeDowngradeHistory;
}

Expand Down Expand Up @@ -107,9 +108,9 @@ export interface BalanceSheetStatement {
totalCurrentLiabilities: number;
totalLiab: number;
commonStock?: number;
retainedEarnings: number;
treasuryStock: number;
otherStockholderEquity: number;
retainedEarnings?: number;
treasuryStock?: number;
otherStockholderEquity?: number;
totalStockholderEquity: number;
netTangibleAssets: number;
goodWill?: number;
Expand All @@ -123,8 +124,8 @@ export interface BalanceSheetStatement {
export interface CalendarEvents {
maxAge: number;
earnings: CalendarEventsEarnings;
exDividendDate?: number;
dividendDate?: number;
exDividendDate?: Date;
dividendDate?: Date;
}

export interface CalendarEventsEarnings {
Expand Down Expand Up @@ -653,6 +654,56 @@ export interface SummaryProfile {
fax?: string;
}

export interface TopHoldings {
maxAge: number;
stockPosition: number;
bondPosition: number;
holdings: TopHoldingsHolding[];
equityHoldings: TopHoldingsEquityHoldings;
bondHoldings: object;
bondRatings: TopHoldingsBondRating[];
sectorWeightings: TopHoldingsSectorWeighting[];
}

export interface TopHoldingsHolding {
symbol: string;
holdingName: string;
holdingPercent: number;
}

export interface TopHoldingsEquityHoldings {
priceToEarnings: number;
priceToBook: number;
priceToSales: number;
priceToCashflow: number;
}

export interface TopHoldingsBondRating {
a?: number;
aa?: number;
aaa?: number;
other?: number;
b?: number;
bb?: number;
bbb?: number;
below_b?: number;
us_government?: number;
}

export interface TopHoldingsSectorWeighting {
realestate?: number;
consumer_cyclical?: number;
basic_materials?: number;
consumer_defensive?: number;
technology?: number;
communication_services?: number;
financial_services?: number;
utilities?: number;
industrials?: number;
energy?: number;
healthcare?: number;
}

export interface UpgradeDowngradeHistory {
history: UpgradeDowngradeHistoryHistory[];
maxAge: number;
Expand Down

0 comments on commit 904934a

Please sign in to comment.