Skip to content
This repository was archived by the owner on Sep 27, 2023. It is now read-only.

Commit 9c18233

Browse files
authored
Merge pull request #57 from BuffettCode/development
Release v9
2 parents 174fb12 + 384cc51 commit 9c18233

53 files changed

Lines changed: 2171 additions & 1206 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

src/__mocks__/api/v3/client.ts

Lines changed: 12 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
import { default as company } from '~/__mocks__/fixtures/v3/company.js'
22
import { default as daily } from '~/__mocks__/fixtures/v3/daily.js'
33
import { default as quarter } from '~/__mocks__/fixtures/v3/quarter.js'
4+
import { Daily } from '~/entities/v3/daily'
5+
import { Quarter } from '~/entities/v3/quarter'
46

57
export class BuffettCodeApiClientV3 {
68
public mockCompany = jest.fn()
@@ -13,28 +15,23 @@ export class BuffettCodeApiClientV3 {
1315
this.mockQuarter.mockReturnValue(quarter)
1416
}
1517

16-
company(): object | null {
17-
const company = this.mockCompany()['data']
18-
return company ? company : null
18+
company(): object {
19+
return this.mockCompany()['data']
1920
}
2021

21-
quarter(): object | null {
22-
const quarter = this.mockQuarter()['data']
23-
return quarter ? quarter : null
22+
quarter(): Quarter {
23+
return Quarter.fromResponse(this.mockQuarter())
2424
}
2525

26-
daily(): object | null {
27-
const daily = this.mockDaily()['data']
28-
return daily ? daily : null
26+
daily(): Daily {
27+
return Daily.fromResponse(this.mockDaily())
2928
}
3029

31-
ondemandDaily(): object | null {
32-
const daily = this.mockDaily()['data']
33-
return daily ? daily : null
30+
ondemandDaily(): Daily {
31+
return Daily.fromResponse(this.mockDaily())
3432
}
3533

36-
ondemandQuarter(): object | null {
37-
const quarter = this.mockQuarter()['data']
38-
return quarter ? quarter : null
34+
ondemandQuarter(): Quarter {
35+
return Quarter.fromResponse(this.mockQuarter())
3936
}
4037
}

src/__mocks__/fixtures/v2/company.js

Lines changed: 19 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,26 @@
11
module.exports = {
2-
'2371': [
2+
2371: [
33
{
44
tosyo_33category: 'サービス業',
55
url: 'http://corporate.kakaku.com/',
66
company_name: 'カカクコム',
77
company_name_en: 'Kakaku.com Inc.',
88
fiscal_month: 3.0,
9-
established_date: '1997/12',
9+
established_date: '1997/12/01',
1010
listing_date: '2003/10/09',
1111
priority_market: 't1',
1212
accounting_standard: 'IFRS',
13-
latest_fiscal_year: 2020.0,
14-
latest_fiscal_quarter: 1.0,
15-
oldest_fiscal_year: 2008.0,
13+
latest_fiscal_year: 2021.0,
14+
latest_fiscal_quarter: 2.0,
15+
oldest_fiscal_year: 2001.0,
1616
oldest_fiscal_quarter: 4.0,
17+
oldest_date: '2003-10-10',
1718
fixed_tier_range: {
18-
oldest_fiscal_year: 2015.0,
19-
oldest_fiscal_quarter: 1.0,
20-
latest_fiscal_year: 2020.0,
21-
latest_fiscal_quarter: 1.0
19+
oldest_fiscal_year: 2016.0,
20+
oldest_fiscal_quarter: 3.0,
21+
latest_fiscal_year: 2021.0,
22+
latest_fiscal_quarter: 2.0,
23+
oldest_date: '2016-11-13T00:00:00.000Z'
2224
}
2325
}
2426
],
@@ -75,6 +77,10 @@ module.exports = {
7577
name_jp: '取得可能な最古の決算四半期',
7678
unit: 'なし'
7779
},
80+
oldest_date: {
81+
name_jp: '取得可能な最古の日付',
82+
unit: 'なし'
83+
},
7884
fixed_tier_range: {
7985
oldest_fiscal_year: {
8086
name_jp: '定額利用可能な下限の決算年度',
@@ -91,6 +97,10 @@ module.exports = {
9197
latest_fiscal_quarter: {
9298
name_jp: '定額利用可能な上限の決算四半期',
9399
unit: 'なし'
100+
},
101+
oldest_date: {
102+
name_jp: '定額利用可能な下限の日付',
103+
unit: 'なし'
94104
}
95105
}
96106
}

src/__mocks__/fixtures/v3/company.js

Lines changed: 22 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,25 @@
11
module.exports = {
2-
'data': {
2+
data: {
33
tosyo_33category: 'サービス業',
44
url: 'http://corporate.kakaku.com/',
55
company_name: 'カカクコム',
66
company_name_en: 'Kakaku.com Inc.',
7-
fiscal_month: 3.0,
8-
established_date: '1997/12',
7+
fiscal_month: 3,
8+
established_date: '1997/12/01',
99
listing_date: '2003/10/09',
1010
priority_market: 't1',
1111
accounting_standard: 'IFRS',
12-
latest_fiscal_year: 2020.0,
13-
latest_fiscal_quarter: 1.0,
14-
oldest_fiscal_year: 2008.0,
15-
oldest_fiscal_quarter: 4.0,
16-
fixed_tier_range: {
17-
oldest_fiscal_year: 2015.0,
18-
oldest_fiscal_quarter: 1.0,
19-
latest_fiscal_year: 2020.0,
20-
latest_fiscal_quarter: 1.0
12+
latest_fiscal_year: 2021,
13+
latest_fiscal_quarter: 2,
14+
oldest_fiscal_year: 2001,
15+
oldest_fiscal_quarter: 4,
16+
oldest_date: '2003-10-10',
17+
fixed_tier_range: {
18+
oldest_fiscal_year: 2016,
19+
oldest_fiscal_quarter: 3,
20+
latest_fiscal_year: 2021,
21+
latest_fiscal_quarter: 2,
22+
oldest_date: '2016-11-13'
2123
}
2224
},
2325
column_description: {
@@ -73,6 +75,10 @@ module.exports = {
7375
name_jp: '取得可能な最古の決算四半期',
7476
unit: 'なし'
7577
},
78+
oldest_date: {
79+
name_jp: '取得可能な最古の日付',
80+
unit: 'なし'
81+
},
7682
fixed_tier_range: {
7783
oldest_fiscal_year: {
7884
name_jp: '定額利用可能な下限の決算年度',
@@ -89,6 +95,10 @@ module.exports = {
8995
latest_fiscal_quarter: {
9096
name_jp: '定額利用可能な上限の決算四半期',
9197
unit: 'なし'
98+
},
99+
oldest_date: {
100+
name_jp: '定額利用可能な下限の日付',
101+
unit: 'なし'
92102
}
93103
}
94104
}

src/__mocks__/fixtures/v3/daily-property.js

Lines changed: 0 additions & 82 deletions
This file was deleted.

0 commit comments

Comments
 (0)