Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(cb2-10273): remove duplicate doc retrieval code #54

Merged
merged 1 commit into from
Jan 10, 2024

Conversation

me-matt
Copy link
Contributor

@me-matt me-matt commented Dec 18, 2023

Remove duplicate doc retrieval code

Removed duplicate code as per SonarQube report.

CB2-10273

Checklist

  • Code has been tested manually
  • PR title includes the JIRA ticket number
  • Branch is rebased against the latest develop
  • Squashed commit contains the JIRA ticket number

@cb-cs
Copy link
Contributor

cb-cs commented Dec 19, 2023

Hi Matt, is it possible to add the following to the .gitIgnore file please? As most on the DVSA side use Webstorm so that directory is being tracked when running locally.

# Idea specific hidden files
.idea/**

const isPlate = plateSerialNumber && !vin && !testNumber && !systemNumber;
const isLetter = !plateSerialNumber && vin && !testNumber && systemNumber;

if (isCertificate) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Might be better to have a switch instead

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I generally avoid switches. Any compelling reason to change?

vinNumber, plateSerialNumber, testNumber, systemNumber,
} = req.query;

documentRequestFactory(vinNumber as string, testNumber as string, plateSerialNumber as string, systemNumber as string)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why have you opted for a factory pattern here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Each retrieval method should really be a strategy. I used a factory as it's the simplest way to reduce the duplication and I didn't want abstraction leaks in the API tier.

@me-matt
Copy link
Contributor Author

me-matt commented Dec 19, 2023

Hi Matt, is it possible to add the following to the .gitIgnore file please? As most on the DVSA side use Webstorm so that directory is being tracked when running locally.

# Idea specific hidden files
.idea/**

This has already been added @cb-cs 👍

@me-matt me-matt requested a review from Daniel-Searle January 8, 2024 11:22
@me-matt me-matt merged commit c3419d1 into develop Jan 10, 2024
4 checks passed
@me-matt me-matt deleted the feature/CB2-10273 branch January 10, 2024 10:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants