From 99287e109ee49f2276852d1b5cbe47902003a3aa Mon Sep 17 00:00:00 2001 From: oscar-richardson-softwire Date: Thu, 30 May 2024 16:19:15 +0100 Subject: [PATCH] feat(DTFS2-7121): change response format to make mapping in DTFS easier --- src/modules/companies/companies.service.ts | 6 ++--- .../companies/dto/get-company-response.dto.ts | 6 ++--- ...or-get-company-by-registration-number.json | 24 +++++++------------ .../generator/get-company-generator.ts | 6 ++--- 4 files changed, 14 insertions(+), 28 deletions(-) diff --git a/src/modules/companies/companies.service.ts b/src/modules/companies/companies.service.ts index 735d5108..9bf38ca7 100644 --- a/src/modules/companies/companies.service.ts +++ b/src/modules/companies/companies.service.ts @@ -72,10 +72,8 @@ export class CompaniesService { industryClasses.forEach((industryClass) => { if (sicCode === industryClass.ukefIndustryId) { industries.push({ - sector: { - code: industryClass.ukefSectorId.toString(), - name: industryClass.ukefSectorName, - }, + code: industryClass.ukefSectorId.toString(), + name: industryClass.ukefSectorName, class: { code: industryClass.ukefIndustryId, name: industryClass.ukefIndustryName, diff --git a/src/modules/companies/dto/get-company-response.dto.ts b/src/modules/companies/dto/get-company-response.dto.ts index 38c9c238..21c217b1 100644 --- a/src/modules/companies/dto/get-company-response.dto.ts +++ b/src/modules/companies/dto/get-company-response.dto.ts @@ -14,10 +14,8 @@ export class GetCompanyResponse { } export class Industry { - sector: { - code: string; - name: string; - }; + code: string; + name: string; class: { code: string; name: string; diff --git a/src/modules/companies/examples/example-response-for-get-company-by-registration-number.json b/src/modules/companies/examples/example-response-for-get-company-by-registration-number.json index 195f64ca..7087668a 100644 --- a/src/modules/companies/examples/example-response-for-get-company-by-registration-number.json +++ b/src/modules/companies/examples/example-response-for-get-company-by-registration-number.json @@ -13,40 +13,32 @@ "code": "59112", "name": "Video production activities" }, - "sector": { - "code": "1009", - "name": "Information and communication" - } + "code": "1009", + "name": "Information and communication" }, { "class": { "code": "62012", "name": "Business and domestic software development" }, - "sector": { - "code": "1009", - "name": "Information and communication" - } + "code": "1009", + "name": "Information and communication" }, { "class": { "code": "62020", "name": "Information technology consultancy activities" }, - "sector": { - "code": "1009", - "name": "Information and communication" - } + "code": "1009", + "name": "Information and communication" }, { "class": { "code": "62090", "name": "Other information technology service activities" }, - "sector": { - "code": "1009", - "name": "Information and communication" - } + "code": "1009", + "name": "Information and communication" } ] } \ No newline at end of file diff --git a/test/support/generator/get-company-generator.ts b/test/support/generator/get-company-generator.ts index 302aa73c..f6ca6492 100644 --- a/test/support/generator/get-company-generator.ts +++ b/test/support/generator/get-company-generator.ts @@ -152,10 +152,8 @@ export class GetCompanyGenerator extends AbstractGenerator ({ - sector: { - code: v.industrySectorCode.toString(), - name: v.industrySectorName, - }, + code: v.industrySectorCode.toString(), + name: v.industrySectorName, class: { code: sicCode, name: v.industryClassNames[index],