fix(GIFT-22117): get UKEF industry code - legacy codes support#1815
Merged
tony-barnes-ukef merged 3 commits intomainfrom Apr 15, 2026
Merged
fix(GIFT-22117): get UKEF industry code - legacy codes support#1815tony-barnes-ukef merged 3 commits intomainfrom
tony-barnes-ukef merged 3 commits intomainfrom
Conversation
Up to standards ✅🟢 Issues
|
| Metric | Results |
|---|---|
| Complexity | 8 |
| Duplication | 8 |
TIP This summary will be updated as you push new changes. Give us feedback
|
There was a problem hiding this comment.
Pull request overview
This PR fixes lookup of UKEF industry codes for legacy Companies House SIC codes by switching the ODS stored procedure query parameter based on the input code length.
Changes:
- Add legacy/modern SIC length constants under
COMPANIES.INDUSTRY_CODEand remove the oldCOMPANIES_HOUSE.INDUSTRY_CODEconstants. - Update
OdsService.findUkefIndustryCodeByCompaniesHouseCodeto query ODS usingsic_industry_codefor modern (5-digit) codes, otherwisesic_section_code. - Update DTO validation bounds and adjust API/unit tests accordingly.
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| test/ods/ods.ukef-industries.api-test.ts | Updates API tests to cover modern vs legacy industry code lengths and adjusted validation errors. |
| src/modules/ods/ods.service.ts | Switches ODS query parameter key based on industry code length. |
| src/modules/ods/ods.service-findUkefIndustryCodeByCompaniesHouseCode.test.ts | Expands unit tests for modern/legacy (and other) lengths, but currently asserts the wrong query param key for legacy paths. |
| src/modules/ods/dto/ods-payloads.dto.ts | Adds sic_section_code to the allowed stored procedure query params type. |
| src/modules/ods/dto/get-ods-ukef-industry-code-param.dto.ts | Updates validation to enforce min legacy length and max modern length using COMPANIES.INDUSTRY_CODE. |
| src/constants/examples/examples.constant.ts | Updates the 4-digit Companies House industry code example value used in tests. |
| src/constants/companies.constant.ts | Introduces INDUSTRY_CODE.LEGACY_LENGTH and .MODERN_LENGTH. |
| src/constants/companies-house.constant.ts | Removes INDUSTRY_CODE length constants from COMPANIES_HOUSE. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
zainUKEF
approved these changes
Apr 15, 2026
tony-barnes-ukef
pushed a commit
that referenced
this pull request
Apr 15, 2026
🤖 I have created a release *beep* *boop* --- ## [1.49.1](v1.49.0...v1.49.1) (2026-04-15) ### Bug Fixes * **GIFT-22117:** get UKEF industry code - legacy codes support ([#1815](#1815)) ([79136ea](79136ea)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Introduction ✏️
Legacy industry codes was not working as expected.
This PR updates the ODS call to send a
sic_section_codequery param if the provided industry code is not an exact length.Resolution ✔️
odsService.findUkefIndustryCodeByCompaniesHouseCode.Miscellaneous ➕
List any additional fixes or improvements.
Request / response 👀
Show/hide
Screenshot(s) 📸
Show/hide
Add screenshots here.