Skip to content

Commit

Permalink
feat(DTFS2-7121): change response format to make mapping in DTFS easier
Browse files Browse the repository at this point in the history
  • Loading branch information
oscar-richardson-softwire committed May 31, 2024
1 parent f4ca3ad commit 99287e1
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 28 deletions.
6 changes: 2 additions & 4 deletions src/modules/companies/companies.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
6 changes: 2 additions & 4 deletions src/modules/companies/dto/get-company-response.dto.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,8 @@ export class GetCompanyResponse {
}

export class Industry {
sector: {
code: string;
name: string;
};
code: string;
name: string;
class: {
code: string;
name: string;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
]
}
6 changes: 2 additions & 4 deletions test/support/generator/get-company-generator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -152,10 +152,8 @@ export class GetCompanyGenerator extends AbstractGenerator<CompanyValues, Genera
shuffleArray(findSectorIndustriesResponse);

const industries: Industry[] = v.sicCodes.map((sicCode, index) => ({
sector: {
code: v.industrySectorCode.toString(),
name: v.industrySectorName,
},
code: v.industrySectorCode.toString(),
name: v.industrySectorName,
class: {
code: sicCode,
name: v.industryClassNames[index],
Expand Down

0 comments on commit 99287e1

Please sign in to comment.