From e5c4241ccc4f0e8c05f571065ed9eed57aa86b3f Mon Sep 17 00:00:00 2001 From: Akiomi Kamakura Date: Sat, 13 Nov 2021 13:45:37 +0900 Subject: [PATCH 1/5] Update company fixtures --- src/__mocks__/fixtures/v2/company.js | 28 +++++++++++++------ src/__mocks__/fixtures/v3/company.js | 34 +++++++++++++++-------- src/api/company-service.test.ts | 13 ++++----- src/api/ondemand-api-period-range.test.ts | 32 ++++++++++----------- 4 files changed, 62 insertions(+), 45 deletions(-) diff --git a/src/__mocks__/fixtures/v2/company.js b/src/__mocks__/fixtures/v2/company.js index f926ffd..fa498cb 100644 --- a/src/__mocks__/fixtures/v2/company.js +++ b/src/__mocks__/fixtures/v2/company.js @@ -1,24 +1,26 @@ module.exports = { - '2371': [ + 2371: [ { tosyo_33category: 'サービス業', url: 'http://corporate.kakaku.com/', company_name: 'カカクコム', company_name_en: 'Kakaku.com Inc.', fiscal_month: 3.0, - established_date: '1997/12', + established_date: '1997/12/01', listing_date: '2003/10/09', priority_market: 't1', accounting_standard: 'IFRS', - latest_fiscal_year: 2020.0, - latest_fiscal_quarter: 1.0, - oldest_fiscal_year: 2008.0, + latest_fiscal_year: 2021.0, + latest_fiscal_quarter: 2.0, + oldest_fiscal_year: 2001.0, oldest_fiscal_quarter: 4.0, + oldest_date: '2003-10-10', fixed_tier_range: { - oldest_fiscal_year: 2015.0, - oldest_fiscal_quarter: 1.0, - latest_fiscal_year: 2020.0, - latest_fiscal_quarter: 1.0 + oldest_fiscal_year: 2016.0, + oldest_fiscal_quarter: 3.0, + latest_fiscal_year: 2021.0, + latest_fiscal_quarter: 2.0, + oldest_date: '2016-11-13T00:00:00.000Z' } } ], @@ -75,6 +77,10 @@ module.exports = { name_jp: '取得可能な最古の決算四半期', unit: 'なし' }, + oldest_date: { + name_jp: '取得可能な最古の日付', + unit: 'なし' + }, fixed_tier_range: { oldest_fiscal_year: { name_jp: '定額利用可能な下限の決算年度', @@ -91,6 +97,10 @@ module.exports = { latest_fiscal_quarter: { name_jp: '定額利用可能な上限の決算四半期', unit: 'なし' + }, + oldest_date: { + name_jp: '定額利用可能な下限の日付', + unit: 'なし' } } } diff --git a/src/__mocks__/fixtures/v3/company.js b/src/__mocks__/fixtures/v3/company.js index 5256734..5c177a3 100644 --- a/src/__mocks__/fixtures/v3/company.js +++ b/src/__mocks__/fixtures/v3/company.js @@ -1,23 +1,25 @@ module.exports = { - 'data': { + data: { tosyo_33category: 'サービス業', url: 'http://corporate.kakaku.com/', company_name: 'カカクコム', company_name_en: 'Kakaku.com Inc.', - fiscal_month: 3.0, - established_date: '1997/12', + fiscal_month: 3, + established_date: '1997/12/01', listing_date: '2003/10/09', priority_market: 't1', accounting_standard: 'IFRS', - latest_fiscal_year: 2020.0, - latest_fiscal_quarter: 1.0, - oldest_fiscal_year: 2008.0, - oldest_fiscal_quarter: 4.0, - fixed_tier_range: { - oldest_fiscal_year: 2015.0, - oldest_fiscal_quarter: 1.0, - latest_fiscal_year: 2020.0, - latest_fiscal_quarter: 1.0 + latest_fiscal_year: 2021, + latest_fiscal_quarter: 2, + oldest_fiscal_year: 2001, + oldest_fiscal_quarter: 4, + oldest_date: '2003-10-10', + fixed_tier_range: { + oldest_fiscal_year: 2016, + oldest_fiscal_quarter: 3, + latest_fiscal_year: 2021, + latest_fiscal_quarter: 2, + oldest_date: '2016-11-13' } }, column_description: { @@ -73,6 +75,10 @@ module.exports = { name_jp: '取得可能な最古の決算四半期', unit: 'なし' }, + oldest_date: { + name_jp: '取得可能な最古の日付', + unit: 'なし' + }, fixed_tier_range: { oldest_fiscal_year: { name_jp: '定額利用可能な下限の決算年度', @@ -89,6 +95,10 @@ module.exports = { latest_fiscal_quarter: { name_jp: '定額利用可能な上限の決算四半期', unit: 'なし' + }, + oldest_date: { + name_jp: '定額利用可能な下限の日付', + unit: 'なし' } } } diff --git a/src/api/company-service.test.ts b/src/api/company-service.test.ts index 2e67563..88407b8 100644 --- a/src/api/company-service.test.ts +++ b/src/api/company-service.test.ts @@ -20,18 +20,15 @@ test('isOndemandQuarterApiPeriod', () => { const client = new CachingBuffettCodeApiClientV2('token') const service = new CompanyService('2371', client) - expect(service.isOndemandQuarterApiPeriod(new YearQuarter(2014, 4))).toBe( + expect(service.isOndemandQuarterApiPeriod(new YearQuarter(2001, 4))).toBe( true ) - expect(service.isOndemandQuarterApiPeriod(new YearQuarter(2015, 1))).toBe( + expect(service.isOndemandQuarterApiPeriod(new YearQuarter(2016, 2))).toBe( + true + ) + expect(service.isOndemandQuarterApiPeriod(new YearQuarter(2016, 3))).toBe( false ) - expect( - service.isOndemandQuarterApiPeriod(new YearQuarterParam(2014, 4)) - ).toBe(true) - expect( - service.isOndemandQuarterApiPeriod(new YearQuarterParam(2015, 1)) - ).toBe(false) expect( service.isOndemandQuarterApiPeriod(new YearQuarterParam('LY', 'LQ')) ).toBe(false) diff --git a/src/api/ondemand-api-period-range.test.ts b/src/api/ondemand-api-period-range.test.ts index 9cde213..55b5e19 100644 --- a/src/api/ondemand-api-period-range.test.ts +++ b/src/api/ondemand-api-period-range.test.ts @@ -19,20 +19,22 @@ test('selectOndemandQuarterApiPeriod', () => { companyService ) - const from = new YearQuarter(2013, 1) - const to = new YearQuarter(2016, 4) + const from = new YearQuarter(2014, 1) + const to = new YearQuarter(2017, 4) const range = new YearQuarterRange(from, to) expect( ondemandQuarterApiPeriodRange.selectOndemandQuarterApiPeriod(ticker, range) ).toEqual([ - new YearQuarter(2013, 1), - new YearQuarter(2013, 2), - new YearQuarter(2013, 3), - new YearQuarter(2013, 4), new YearQuarter(2014, 1), new YearQuarter(2014, 2), new YearQuarter(2014, 3), - new YearQuarter(2014, 4) + new YearQuarter(2014, 4), + new YearQuarter(2015, 1), + new YearQuarter(2015, 2), + new YearQuarter(2015, 3), + new YearQuarter(2015, 4), + new YearQuarter(2016, 1), + new YearQuarter(2016, 2) ]) }) @@ -44,19 +46,17 @@ test('filterOndemandQuarterApiPeriod', () => { companyService ) - const from = new YearQuarter(2013, 1) - const to = new YearQuarter(2016, 4) + const from = new YearQuarter(2014, 1) + const to = new YearQuarter(2017, 4) const range = new YearQuarterRange(from, to) expect( ondemandQuarterApiPeriodRange.filterOndemandQuarterApiPeriod(ticker, range) ).toEqual([ - new YearQuarter(2015, 1), - new YearQuarter(2015, 2), - new YearQuarter(2015, 3), - new YearQuarter(2015, 4), - new YearQuarter(2016, 1), - new YearQuarter(2016, 2), new YearQuarter(2016, 3), - new YearQuarter(2016, 4) + new YearQuarter(2016, 4), + new YearQuarter(2017, 1), + new YearQuarter(2017, 2), + new YearQuarter(2017, 3), + new YearQuarter(2017, 4) ]) }) From 0b452a3680b3fa4952b64765a93f8422f2868ac8 Mon Sep 17 00:00:00 2001 From: Akiomi Kamakura Date: Sat, 13 Nov 2021 13:46:12 +0900 Subject: [PATCH 2/5] Add CompanyService#isOndemandDailyApiPeriod --- src/api/company-service.test.ts | 24 +++++++++++++++ src/api/company-service.ts | 15 ++++++++- src/custom-functions/v3/bcode-daily.ts | 42 ++++++++++++++++++++++++++ 3 files changed, 80 insertions(+), 1 deletion(-) create mode 100644 src/custom-functions/v3/bcode-daily.ts diff --git a/src/api/company-service.test.ts b/src/api/company-service.test.ts index 88407b8..8625d3a 100644 --- a/src/api/company-service.test.ts +++ b/src/api/company-service.test.ts @@ -1,11 +1,16 @@ import { CompanyService } from '~/api/company-service' import { CachingBuffettCodeApiClientV2 } from '~/api/v2/caching-client' +import { CachingBuffettCodeApiClientV3 } from '~/api/v3/caching-client' +import { DateParam } from '~/fiscal-periods/date-param' import { YearQuarter } from '~/fiscal-periods/year-quarter' import { YearQuarterParam } from '~/fiscal-periods/year-quarter-param' jest.mock('~/api/v2/client', () => jest.requireActual('~/__mocks__/api/v2/client') ) +jest.mock('~/api/v3/client', () => + jest.requireActual('~/__mocks__/api/v3/client') +) jest.mock('~/services/company-cache', () => jest.requireActual('~/__mocks__/services/company-cache') ) @@ -33,3 +38,22 @@ test('isOndemandQuarterApiPeriod', () => { service.isOndemandQuarterApiPeriod(new YearQuarterParam('LY', 'LQ')) ).toBe(false) }) + +test('isOndemandDailyApiPeriod', () => { + const client = new CachingBuffettCodeApiClientV3('token') + const service = new CompanyService('2371', client) + + expect( + service.isOndemandDailyApiPeriod(new DateParam(new Date('2003-10-10'))) + ).toBe(true) + expect( + service.isOndemandDailyApiPeriod(new DateParam(new Date('2016-11-12'))) + ).toBe(true) + expect( + service.isOndemandDailyApiPeriod(new DateParam(new Date('2016-11-13'))) + ).toBe(false) + expect(service.isOndemandDailyApiPeriod(new DateParam(new Date()))).toBe( + false + ) + expect(service.isOndemandDailyApiPeriod(new DateParam('latest'))).toBe(false) +}) diff --git a/src/api/company-service.ts b/src/api/company-service.ts index 3e264b7..1c5bbf6 100644 --- a/src/api/company-service.ts +++ b/src/api/company-service.ts @@ -1,4 +1,6 @@ import { BuffettCodeApiClientV2 } from '~/api/v2/client' +import { BuffettCodeApiClientV3 } from '~/api/v3/client' +import { DateParam } from '~/fiscal-periods/date-param' import { YearQuarter } from '~/fiscal-periods/year-quarter' import { YearQuarterParam } from '~/fiscal-periods/year-quarter-param' @@ -7,7 +9,7 @@ export class CompanyService { constructor( public ticker: string, - client: BuffettCodeApiClientV2, + client: BuffettCodeApiClientV2 | BuffettCodeApiClientV3, private today: Date = new Date() ) { this.company = client.company(ticker) @@ -42,4 +44,15 @@ export class CompanyService { ) return !period.isAfterOrEqual(fixedTierOldestPeriod) } + + public isOndemandDailyApiPeriod(date: DateParam): boolean { + if (date.isLatest()) { + return false + } + + const fixedTierRange = this.company['fixed_tier_range'] + const fixedTierOldestDate = new Date(fixedTierRange['oldest_date']) + + return date.toDate().valueOf() < fixedTierOldestDate.valueOf() + } } diff --git a/src/custom-functions/v3/bcode-daily.ts b/src/custom-functions/v3/bcode-daily.ts new file mode 100644 index 0000000..4b5dd32 --- /dev/null +++ b/src/custom-functions/v3/bcode-daily.ts @@ -0,0 +1,42 @@ +import { CompanyService } from '~/api/company-service' +import { BuffettCodeApiClientV3 } from '~/api/v3/client' +import { BcodeResult } from '~/custom-functions/bcode-result' +import { + ApiResponseError, + OndemandApiNotEnabledError, + UnsupportedTickerError +} from '~/custom-functions/error' +import { Daily } from '~/entities/v3/daily' +import { DateParam } from '~/fiscal-periods/date-param' + +export function bcodeDaily( + client: BuffettCodeApiClientV3, + ticker: string, + date: DateParam, + propertyName: string, + ondemandApiEnabled: boolean +): BcodeResult { + const companyService = new CompanyService(ticker, client) + if (!companyService.isSupportedTicker()) { + throw new UnsupportedTickerError() + } + + let daily: Daily + if (companyService.isOndemandDailyApiPeriod(date)) { + if (!ondemandApiEnabled) { + throw new OndemandApiNotEnabledError() + } + + daily = client.ondemandDaily(ticker, date) + } else { + daily = client.daily(ticker, date) + } + + if (daily == undefined) { + throw new ApiResponseError() + } + + const value = daily.data[propertyName] + const unit = daily.columnDescription[propertyName]['unit'] + return new BcodeResult(value, unit) +} From 419c766d8b209cd8d4c1e8675271e1ad3e5add4c Mon Sep 17 00:00:00 2001 From: Akiomi Kamakura Date: Sat, 13 Nov 2021 14:22:18 +0900 Subject: [PATCH 3/5] Add PropertyNotFoundError --- src/custom-functions/error.test.ts | 8 +++++++- src/custom-functions/error.ts | 9 +++++++++ 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/src/custom-functions/error.test.ts b/src/custom-functions/error.test.ts index e70f5f2..90025b6 100644 --- a/src/custom-functions/error.test.ts +++ b/src/custom-functions/error.test.ts @@ -1,6 +1,7 @@ import { ApiResponseError, - OndemandApiNotEnabledError + OndemandApiNotEnabledError, + PropertyNotFoundError } from '~/custom-functions/error' test('ApiResponseError', () => { @@ -12,3 +13,8 @@ test('OndemandApiNotEnabledError', () => { const error = new OndemandApiNotEnabledError() expect(error instanceof OndemandApiNotEnabledError).toBeTruthy() }) + +test('PropertyNotFoundError', () => { + const error = new PropertyNotFoundError() + expect(error instanceof PropertyNotFoundError).toBeTruthy() +}) diff --git a/src/custom-functions/error.ts b/src/custom-functions/error.ts index 8df2221..e97b712 100644 --- a/src/custom-functions/error.ts +++ b/src/custom-functions/error.ts @@ -16,6 +16,15 @@ export class OndemandApiNotEnabledError implements Error { } } +export class PropertyNotFoundError implements Error { + public name = 'PropertyNotFoundError' + public message: string + + constructor(message = '') { + this.message = message + } +} + export class UnsupportedTickerError implements Error { public name = 'UnsupportedTickerError' public message: string From 6eccdd29d6c4cdf5ba97c3d84274c5a798f0956a Mon Sep 17 00:00:00 2001 From: Akiomi Kamakura Date: Mon, 15 Nov 2021 10:28:42 +0900 Subject: [PATCH 4/5] Add bcodeDaily for v3 --- src/custom-functions/v3/bcode-daily.test.ts | 29 +++++++++++++++++++++ src/custom-functions/v3/bcode-daily.ts | 11 +++++++- 2 files changed, 39 insertions(+), 1 deletion(-) create mode 100644 src/custom-functions/v3/bcode-daily.test.ts diff --git a/src/custom-functions/v3/bcode-daily.test.ts b/src/custom-functions/v3/bcode-daily.test.ts new file mode 100644 index 0000000..9f06c69 --- /dev/null +++ b/src/custom-functions/v3/bcode-daily.test.ts @@ -0,0 +1,29 @@ +import { CachingBuffettCodeApiClientV3 } from '~/api/v3/caching-client' +import { BcodeResult } from '~/custom-functions/bcode-result' +import { bcodeDaily } from '~/custom-functions/v3/bcode-daily' +import { DateParam } from '~/fiscal-periods/date-param' +import { DailyCache } from '~/services/daily-cache' + +jest.mock('~/api/v3/client', () => + jest.requireActual('~/__mocks__/api/v3/client') +) +jest.mock('~/services/company-cache', () => + jest.requireActual('~/__mocks__/services/company-cache') +) +jest.mock('~/services/daily-cache', () => + jest.requireActual('~/__mocks__/services/daily-cache') +) + +test('bcodeDaily', () => { + const ticker = '2371' + const date = new DateParam(new Date('2020-09-06')) + const propertyName = 'market_capital' + + expect(DailyCache.get(ticker, date)).toBeNull() + + const client = new CachingBuffettCodeApiClientV3('token') + const result = bcodeDaily(client, ticker, date, propertyName, false) + + expect(result).toEqual(new BcodeResult(587800541668.0, '百万円')) + expect(DailyCache.get(ticker, date)).not.toBeNull() +}) diff --git a/src/custom-functions/v3/bcode-daily.ts b/src/custom-functions/v3/bcode-daily.ts index 4b5dd32..47422c5 100644 --- a/src/custom-functions/v3/bcode-daily.ts +++ b/src/custom-functions/v3/bcode-daily.ts @@ -4,6 +4,7 @@ import { BcodeResult } from '~/custom-functions/bcode-result' import { ApiResponseError, OndemandApiNotEnabledError, + PropertyNotFoundError, UnsupportedTickerError } from '~/custom-functions/error' import { Daily } from '~/entities/v3/daily' @@ -36,7 +37,15 @@ export function bcodeDaily( throw new ApiResponseError() } + const property = daily.columnDescription[propertyName] + if (property == undefined) { + throw new PropertyNotFoundError( + `propetyName '${propertyName}' is not found.` + ) + } + const value = daily.data[propertyName] - const unit = daily.columnDescription[propertyName]['unit'] + const unit = property['unit'] + return new BcodeResult(value, unit) } From 784d9aba07e7b027835eb50ef7e55aacd11a5073 Mon Sep 17 00:00:00 2001 From: Akiomi Kamakura Date: Mon, 15 Nov 2021 15:53:18 +0900 Subject: [PATCH 5/5] Update fixtures of v3 daily --- src/__mocks__/fixtures/v3/daily-property.js | 82 ------------- src/__mocks__/fixtures/v3/daily.js | 127 +++++++++++--------- src/custom-functions/v3/bcode-daily.test.ts | 2 +- 3 files changed, 69 insertions(+), 142 deletions(-) delete mode 100644 src/__mocks__/fixtures/v3/daily-property.js diff --git a/src/__mocks__/fixtures/v3/daily-property.js b/src/__mocks__/fixtures/v3/daily-property.js deleted file mode 100644 index 614382d..0000000 --- a/src/__mocks__/fixtures/v3/daily-property.js +++ /dev/null @@ -1,82 +0,0 @@ -module.exports = { - cash_market_capital_ratio: { - name_jp: 'キャッシュ時価総額比率', - unit: '%' - }, - debt_market_capital_ratio: { - name_jp: '有利子負債/時価総額比率', - unit: '倍' - }, - dividend_yield_actual: { - name_jp: '配当利回り(実績)', - unit: '%' - }, - dividend_yield_forecast: { - name_jp: '配当利回り(会社予想)', - unit: '%' - }, - ebitda_forecast: { - name_jp: 'EBITDA(会社予想)', - unit: '百万円' - }, - enterprise_value: { - name_jp: '企業価値', - unit: '百万円' - }, - eps_forecast: { - name_jp: 'EPS(会社予想)', - unit: '円' - }, - ev_ebitda_forecast: { - name_jp: 'EV/EBITDA(会社予想)', - unit: '倍' - }, - ex_dividend: { - name_jp: '配当金(会社予想)', - unit: '円' - }, - listing_years: { - name_jp: '上場年数', - unit: '年' - }, - market_capital: { - name_jp: '時価総額', - unit: '百万円' - }, - net_income_growth_rate_forecast: { - name_jp: '純利益成長率(直近年度実績→会社予想)', - unit: '%' - }, - net_sales_growth_rate_forecast: { - name_jp: '売上高成長率(直近年度実績→会社予想)', - unit: '%' - }, - operating_income_growth_rate_forecast: { - name_jp: '営業利益成長率(直近年度実績→会社予想)', - unit: '%' - }, - pbr: { - name_jp: 'PBR', - unit: '倍' - }, - pcfr_forecast: { - name_jp: 'PCFR', - unit: '倍' - }, - per_forecast: { - name_jp: 'PER(会社予想)', - unit: '倍' - }, - per_pbr: { - name_jp: 'PER×PBR', - unit: '単位無し' - }, - psr_forecast: { - name_jp: 'PSR(会社予想)', - unit: '倍' - }, - trading_volume: { - name_jp: '出来高', - unit: '株' - } -} diff --git a/src/__mocks__/fixtures/v3/daily.js b/src/__mocks__/fixtures/v3/daily.js index 66ecc5c..2f3ab5c 100644 --- a/src/__mocks__/fixtures/v3/daily.js +++ b/src/__mocks__/fixtures/v3/daily.js @@ -1,23 +1,19 @@ module.exports = { column_description: { - cash_market_capital_ratio: { - name_jp: 'キャッシュ時価総額比率', - unit: '%' - }, - debt_market_capital_ratio: { - name_jp: '有利子負債/時価総額比率', - unit: '倍' + ticker: { + name_jp: 'ティッカー', + unit: '単位無し' }, - dividend_yield_actual: { - name_jp: '配当利回り(実績)', - unit: '%' + day: { + name_jp: '日付', + unit: '単位無し' }, - dividend_yield_forecast: { - name_jp: '配当利回り(会社予想)', - unit: '%' + trading_volume: { + name_jp: '出来高', + unit: '株' }, - ebitda_forecast: { - name_jp: 'EBITDA(会社予想)', + market_capital: { + name_jp: '時価総額', unit: '百万円' }, enterprise_value: { @@ -28,24 +24,44 @@ module.exports = { name_jp: 'EPS(会社予想)', unit: '円' }, + per_forecast: { + name_jp: 'PER(会社予想)', + unit: '倍' + }, + pbr: { + name_jp: 'PBR', + unit: '倍' + }, + per_pbr: { + name_jp: 'PER×PBR', + unit: '単位無し' + }, + ebitda_forecast: { + name_jp: 'EBITDA(会社予想)', + unit: '百万円' + }, ev_ebitda_forecast: { name_jp: 'EV/EBITDA(会社予想)', unit: '倍' }, + psr_forecast: { + name_jp: 'PSR(会社予想)', + unit: '倍' + }, + pcfr_forecast: { + name_jp: 'PCFR', + unit: '倍' + }, ex_dividend: { name_jp: '配当金(会社予想)', unit: '円' }, - listing_years: { - name_jp: '上場年数', - unit: '年' - }, - market_capital: { - name_jp: '時価総額', - unit: '百万円' + dividend_yield_forecast: { + name_jp: '配当利回り(会社予想)', + unit: '%' }, - net_income_growth_rate_forecast: { - name_jp: '純利益成長率(直近年度実績→会社予想)', + dividend_yield_actual: { + name_jp: '配当利回り(実績)', unit: '%' }, net_sales_growth_rate_forecast: { @@ -56,52 +72,45 @@ module.exports = { name_jp: '営業利益成長率(直近年度実績→会社予想)', unit: '%' }, - pbr: { - name_jp: 'PBR', - unit: '倍' - }, - pcfr_forecast: { - name_jp: 'PCFR', - unit: '倍' + net_income_growth_rate_forecast: { + name_jp: '純利益成長率(直近年度実績→会社予想)', + unit: '%' }, - per_forecast: { - name_jp: 'PER(会社予想)', + debt_market_capital_ratio: { + name_jp: '有利子負債/時価総額比率', unit: '倍' }, - per_pbr: { - name_jp: 'PER×PBR', - unit: '単位無し' - }, - psr_forecast: { - name_jp: 'PSR(会社予想)', - unit: '倍' + cash_market_capital_ratio: { + name_jp: 'キャッシュ時価総額比率', + unit: '%' }, - trading_volume: { - name_jp: '出来高', - unit: '株' + listing_years: { + name_jp: '上場年数', + unit: '年' } }, data: { + ticker: '2371', day: '2020-09-06', - cash_market_capital_ratio: 4.98944759676063, - debt_market_capital_ratio: 1.48298604408628, - dividend_yield_actual: 1.40154169586545, - dividend_yield_forecast: 1.40154169586545, - ebitda_forecast: null, - enterprise_value: 567189541668.0, + trading_volume: 636600, + market_capital: 550294097166, + enterprise_value: 535358097166, eps_forecast: 0.0, - ev_ebitda_forecast: null, - ex_dividend: 40.0, - listing_years: 17.0, - market_capital: 587800541668.0, - net_income_growth_rate_forecast: -100.0, - net_sales_growth_rate_forecast: -100.0, - operating_income_growth_rate_forecast: -100.0, - pbr: 13.3959420603934, - pcfr_forecast: 182.603461220255, per_forecast: null, + pbr: 13.66, per_pbr: null, + ebitda_forecast: null, + ev_ebitda_forecast: null, psr_forecast: null, - trading_volume: 437700.0 + pcfr_forecast: 170.95, + ex_dividend: 40, + dividend_yield_forecast: 1.5, + dividend_yield_actual: 1.5, + net_sales_growth_rate_forecast: -100.0, + operating_income_growth_rate_forecast: -100.0, + net_income_growth_rate_forecast: -100.0, + debt_market_capital_ratio: 1.6, + cash_market_capital_ratio: 4.31, + listing_years: 16 } } diff --git a/src/custom-functions/v3/bcode-daily.test.ts b/src/custom-functions/v3/bcode-daily.test.ts index 9f06c69..5f2934d 100644 --- a/src/custom-functions/v3/bcode-daily.test.ts +++ b/src/custom-functions/v3/bcode-daily.test.ts @@ -24,6 +24,6 @@ test('bcodeDaily', () => { const client = new CachingBuffettCodeApiClientV3('token') const result = bcodeDaily(client, ticker, date, propertyName, false) - expect(result).toEqual(new BcodeResult(587800541668.0, '百万円')) + expect(result).toEqual(new BcodeResult(550294097166, '百万円')) expect(DailyCache.get(ticker, date)).not.toBeNull() })