Skip to content
This repository was archived by the owner on Sep 27, 2023. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
4087e5e
Add PeriodParser
akiomik Nov 6, 2021
62fc867
Fix for node v8
akiomik Nov 6, 2021
eac6568
Merge pull request #48 from BuffettCode/add-period-parser
shoe116 Nov 8, 2021
d60d0f9
Add Daily
akiomik Nov 10, 2021
98fd839
Add v3-style testing apikey error suuport
akiomik Nov 10, 2021
bfdf6b2
Add 403 handling
akiomik Nov 10, 2021
fee5cff
Merge pull request #50 from BuffettCode/improve-error-handling
akiomik Nov 10, 2021
6c83c05
Merge pull request #49 from BuffettCode/add-daily
akiomik Nov 10, 2021
c385b1e
Fix mock of DailyCache
akiomik Nov 13, 2021
715c4d4
Merge pull request #51 from BuffettCode/fix-daily-cache-mock
akiomik Nov 15, 2021
c455500
Add Quarter entity
akiomik Nov 13, 2021
a121126
Merge pull request #52 from BuffettCode/add-quarter
akiomik Nov 15, 2021
e5c4241
Update company fixtures
akiomik Nov 13, 2021
0b452a3
Add CompanyService#isOndemandDailyApiPeriod
akiomik Nov 13, 2021
419c766
Add PropertyNotFoundError
akiomik Nov 13, 2021
6eccdd2
Add bcodeDaily for v3
akiomik Nov 15, 2021
784d9ab
Update fixtures of v3 daily
akiomik Nov 15, 2021
df55d48
Merge pull request #53 from BuffettCode/add-bcode-v3-daily
akiomik Nov 15, 2021
0ab19fb
Update fixture for v3 quarter
akiomik Nov 15, 2021
2839a48
Add bcodeQuarter for v3
akiomik Nov 15, 2021
5b158c0
Merge pull request #54 from BuffettCode/add-bcode-v3-quarter
akiomik Nov 17, 2021
0108604
Add bcode v3
akiomik Nov 17, 2021
f719d98
Update fixtures
akiomik Nov 19, 2021
e09cca6
Add new BcodeResult
akiomik Nov 19, 2021
d555d05
Merge pull request #55 from BuffettCode/add-bcode-v3
akiomik Nov 19, 2021
4e31415
Update JSDoc
akiomik Nov 19, 2021
8132afe
Improve error handling
akiomik Nov 19, 2021
dc925eb
Merge pull request #56 from BuffettCode/improve-bcode
akiomik Nov 19, 2021
353db05
Bump version to v9
akiomik Nov 19, 2021
384cc51
Merge pull request #58 from BuffettCode/bump-version-to-v9
akiomik Nov 19, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 12 additions & 15 deletions src/__mocks__/api/v3/client.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import { default as company } from '~/__mocks__/fixtures/v3/company.js'
import { default as daily } from '~/__mocks__/fixtures/v3/daily.js'
import { default as quarter } from '~/__mocks__/fixtures/v3/quarter.js'
import { Daily } from '~/entities/v3/daily'
import { Quarter } from '~/entities/v3/quarter'

export class BuffettCodeApiClientV3 {
public mockCompany = jest.fn()
Expand All @@ -13,28 +15,23 @@ export class BuffettCodeApiClientV3 {
this.mockQuarter.mockReturnValue(quarter)
}

company(): object | null {
const company = this.mockCompany()['data']
return company ? company : null
company(): object {
return this.mockCompany()['data']
}

quarter(): object | null {
const quarter = this.mockQuarter()['data']
return quarter ? quarter : null
quarter(): Quarter {
return Quarter.fromResponse(this.mockQuarter())
}

daily(): object | null {
const daily = this.mockDaily()['data']
return daily ? daily : null
daily(): Daily {
return Daily.fromResponse(this.mockDaily())
}

ondemandDaily(): object | null {
const daily = this.mockDaily()['data']
return daily ? daily : null
ondemandDaily(): Daily {
return Daily.fromResponse(this.mockDaily())
}

ondemandQuarter(): object | null {
const quarter = this.mockQuarter()['data']
return quarter ? quarter : null
ondemandQuarter(): Quarter {
return Quarter.fromResponse(this.mockQuarter())
}
}
28 changes: 19 additions & 9 deletions src/__mocks__/fixtures/v2/company.js
Original file line number Diff line number Diff line change
@@ -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'
}
}
],
Expand Down Expand Up @@ -75,6 +77,10 @@ module.exports = {
name_jp: '取得可能な最古の決算四半期',
unit: 'なし'
},
oldest_date: {
name_jp: '取得可能な最古の日付',
unit: 'なし'
},
fixed_tier_range: {
oldest_fiscal_year: {
name_jp: '定額利用可能な下限の決算年度',
Expand All @@ -91,6 +97,10 @@ module.exports = {
latest_fiscal_quarter: {
name_jp: '定額利用可能な上限の決算四半期',
unit: 'なし'
},
oldest_date: {
name_jp: '定額利用可能な下限の日付',
unit: 'なし'
}
}
}
Expand Down
34 changes: 22 additions & 12 deletions src/__mocks__/fixtures/v3/company.js
Original file line number Diff line number Diff line change
@@ -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: {
Expand Down Expand Up @@ -73,6 +75,10 @@ module.exports = {
name_jp: '取得可能な最古の決算四半期',
unit: 'なし'
},
oldest_date: {
name_jp: '取得可能な最古の日付',
unit: 'なし'
},
fixed_tier_range: {
oldest_fiscal_year: {
name_jp: '定額利用可能な下限の決算年度',
Expand All @@ -89,6 +95,10 @@ module.exports = {
latest_fiscal_quarter: {
name_jp: '定額利用可能な上限の決算四半期',
unit: 'なし'
},
oldest_date: {
name_jp: '定額利用可能な下限の日付',
unit: 'なし'
}
}
}
Expand Down
82 changes: 0 additions & 82 deletions src/__mocks__/fixtures/v3/daily-property.js

This file was deleted.

Loading