Skip to content

Commit 229728b

Browse files
authored
Merge pull request #111 from companieshouse/BI-7098-align-dissolved-search-model-to-api-spec
update dissolved search model to align with spec update test
2 parents 7f7528e + bb61089 commit 229728b

File tree

2 files changed

+14
-14
lines changed

2 files changed

+14
-14
lines changed

src/services/search/dissolved-search/types.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ export interface Items {
1010
company_name: string;
1111
company_number: string;
1212
company_status: string;
13-
date_of_cessation: string;
14-
date_of_creation: string;
13+
date_of_cessation: Date;
14+
date_of_creation: Date;
1515
kind: string;
1616
previous_company_names: PreviousCompanyNames[];
1717
}
@@ -22,8 +22,8 @@ export interface Address {
2222
}
2323

2424
export interface PreviousCompanyNames {
25-
ceased_on: string;
26-
effective_from: string;
25+
ceased_on: Date;
26+
effective_from: Date;
2727
name: string;
2828
}
2929

@@ -32,8 +32,8 @@ export interface TopHit {
3232
company_name: string;
3333
company_number: string;
3434
company_status: string;
35-
date_of_cessation: string;
36-
date_of_creation: string;
35+
date_of_cessation: Date;
36+
date_of_creation: Date;
3737
kind: string;
3838
previous_company_names: PreviousCompanyNames[];
3939
}

test/services/search/dissolved-search/service.spec.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,13 @@ const mockResponseBody : CompaniesResource = ({
2020
company_name: "test company",
2121
company_number: "0000789",
2222
company_status: "active",
23-
date_of_cessation: "19910212",
24-
date_of_creation: "19910212",
23+
date_of_cessation: (new Date("19910212")),
24+
date_of_creation: (new Date("19910212")),
2525
kind: "kind",
2626
previous_company_names: [
2727
{
28-
ceased_on: "19910212",
29-
effective_from: "19910212",
28+
ceased_on: (new Date("19910212")),
29+
effective_from: (new Date("19910212")),
3030
name: "old name"
3131
}
3232
]
@@ -41,13 +41,13 @@ const mockResponseBody : CompaniesResource = ({
4141
company_name: "test company",
4242
company_number: "0000789",
4343
company_status: "active",
44-
date_of_cessation: "19910212",
45-
date_of_creation: "19910212",
44+
date_of_cessation: (new Date("19910212")),
45+
date_of_creation: (new Date("19910212")),
4646
kind: "kind",
4747
previous_company_names: [
4848
{
49-
ceased_on: "19910212",
50-
effective_from: "19910212",
49+
ceased_on: (new Date("19910212")),
50+
effective_from: (new Date("19910212")),
5151
name: "old name"
5252
}
5353
]

0 commit comments

Comments
 (0)