Skip to content

Commit

Permalink
fix(quoteSummary): sellingGeneralAdministrative (fixes #258)
Browse files Browse the repository at this point in the history
IncomeStatementHistoryElement > sellingGeneralAdministrative
Previously allowed type "number" only, but now accepts null too.

As noted in symbol "CMCOM.AS" (test added)
  • Loading branch information
gadicc committed Aug 12, 2021
1 parent 4991ae9 commit c01fe74
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
2 changes: 1 addition & 1 deletion schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -5138,7 +5138,7 @@
"yahooFinanceType": "number|null"
},
"sellingGeneralAdministrative": {
"yahooFinanceType": "number"
"yahooFinanceType": "number|null"
},
"nonRecurring": {
"yahooFinanceType": "number|null"
Expand Down
2 changes: 1 addition & 1 deletion src/modules/quoteSummary-iface.ts
Original file line number Diff line number Diff line change
Expand Up @@ -513,7 +513,7 @@ export interface IncomeStatementHistoryElement {
costOfRevenue: number;
grossProfit: number;
researchDevelopment: number | null;
sellingGeneralAdministrative: number;
sellingGeneralAdministrative: number | null;
nonRecurring: number | null;
otherOperatingExpenses: number | null;
totalOperatingExpenses: number;
Expand Down
9 changes: 8 additions & 1 deletion src/modules/quoteSummary.spec.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,16 @@
import quoteSummary, { QuoteSummaryModules } from "./quoteSummary.js";
import { InvalidOptionsError } from "../lib/errors.js";

import { testSymbols } from "../../tests/symbols.js";
import { testSymbols as commonTestSymbols } from "../../tests/symbols.js";
import testYf from "../../tests/testYf.js";

const testSymbols = [
...commonTestSymbols,
// incomeStatementHistory/sellingGeneralAdministrative is null (#258)
// "Got {}->null for 'number', did you want 'number | null' ?"
"CMCOM.AS",
];

const yf = testYf({ quoteSummary });

interface itValidatesOpts {
Expand Down

0 comments on commit c01fe74

Please sign in to comment.