-
Notifications
You must be signed in to change notification settings - Fork 1
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
Conversation
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.
|
const isPlate = plateSerialNumber && !vin && !testNumber && !systemNumber; | ||
const isLetter = !plateSerialNumber && vin && !testNumber && systemNumber; | ||
|
||
if (isCertificate) { |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
This has already been added @cb-cs 👍 |
Remove duplicate doc retrieval code
Removed duplicate code as per SonarQube report.
CB2-10273
Checklist