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

Feature/cb2 10593 - update parseAdrDetails function #78

Open
wants to merge 12 commits into
base: develop
Choose a base branch
from

Conversation

meys-bjss
Copy link

@meys-bjss meys-bjss commented Feb 1, 2024

Description

Updating the update-store's parseAdrDetails functionality so that it parses the ADR Details attribute in a given tech record if the adrDetails attribute exists.

Related issue:
CB2-10593
CB2-10592

Useful links:
https://dvsa.atlassian.net/wiki/spaces/HVT/pages/382011842/ADR+Section
https://dvsa.atlassian.net/wiki/spaces/HVT/pages/494174610/SPIKE+Validate+existing+update-store+functionality+for+ADR

Before submitting (or marking as "ready for review")

  • Does the pull request title follow the conventional commit specification?
  • Have you performed a self-review of the code
  • Have you have added tests that prove the fix or feature is effective and working
  • Did you make sure to update any documentation relating to this change?

@meys-bjss meys-bjss changed the title Feature/cb2 10593 Feature/cb2 10593 - update parseAdrDetails function Feb 1, 2024
shivangidas
shivangidas previously approved these changes Feb 5, 2024
Nat-McCabe-BJSS
Nat-McCabe-BJSS previously approved these changes Feb 7, 2024
Copy link
Contributor

@Nat-McCabe-BJSS Nat-McCabe-BJSS left a comment

Choose a reason for hiding this comment

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

Great work, very nice job at writing your own Typescript too, add it to your AMP 👀

@@ -1,5 +1,5 @@
# Match Aurora MySQL version as closely as possible
FROM mysql:5.7.12
FROM mysql:8.2.0
Copy link
Contributor

Choose a reason for hiding this comment

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

Are we OK to change this? I was just wondering if it's best to leave it as is and you just change the version locally

@meys-bjss meys-bjss dismissed stale reviews from Nat-McCabe-BJSS and shivangidas via 7ac372f February 7, 2024 10:25
Nat-McCabe-BJSS
Nat-McCabe-BJSS previously approved these changes Feb 7, 2024
weight?: string;
compatibilityGroupJ?: boolean;
weight?: number;
newCertificateRequested?: boolean;
Copy link

@simontindallbjss simontindallbjss Feb 8, 2024

Choose a reason for hiding this comment

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

This is not required as it is a front end field for UX

Copy link
Contributor

@Nat-McCabe-BJSS Nat-McCabe-BJSS Feb 8, 2024

Choose a reason for hiding this comment

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

Weight is listed as a number in ADR section, so I would presume that is required, it's how I've done it in Pydantic. CompatibilityGroupJ should still be listed though no? NewCertificateRequested is also in the ADR section documentation that should also be needed

Copy link
Author

Choose a reason for hiding this comment

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

@simontindallbjss, newCertificateRequested is removed from the final upsert function for now, so it wouldn't end up in NOP. we can always add it whenever needed. Note that all the attributes are defined as 'optional', so fine if they don't exist in the payload.

documents?: string[];
permittedDangerousGoods?: string[];
additionalExaminerNotes?: string;
permittedDangerousGoods?: permittedDangerousGoodsEnum[];

Choose a reason for hiding this comment

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

ADR documentation states that this shouldn't be an enum in the backend due to the historic data containing erroneous values

Copy link
Author

Choose a reason for hiding this comment

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

As previously discussed with @reisedawson-bjss, at this stage, we are going to keep them as Enums. After the first round of remediation (hopefully in pre-prod), if this creates a massive issue, we can always turn them into
general "string" type.

applicantDetails?: ApplicantDetails;
memosApply?: string[];
dangerousGoods?: boolean;
memosApply?: memosApplyEnum[];

Choose a reason for hiding this comment

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

ADR documentation states that this shouldn't be an enum in the backend due to the historic data containing erroneous values

Copy link
Author

Choose a reason for hiding this comment

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

Same as permittedDangerousGoodsEnum case

@Nat-McCabe-BJSS Nat-McCabe-BJSS dismissed their stale review February 8, 2024 10:47

CompatibilityGroupJ query and enum typings need fixing

export interface VehicleDetails {
type?: string;
type?: VehicleDetailsTypeEnum;
Copy link
Contributor

Choose a reason for hiding this comment

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

Should be a string in the backend

Copy link
Author

Choose a reason for hiding this comment

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

Same as permittedDangerousGoodsEnum case

@@ -36,8 +114,8 @@ export interface ApplicantDetails {
}

export interface AdditionalNotes {
number?: string[];
guidanceNotes?: string[];
number?: additionalNotesNumberEnum[];
Copy link
Contributor

Choose a reason for hiding this comment

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

Should be array of strings in backend

export interface VehicleDetails {
type?: string;
type?: VehicleDetailsTypeEnum;

Choose a reason for hiding this comment

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

ADR documentation states that this shouldn't be an enum in the backend due to the historic data containing erroneous values

Copy link
Author

Choose a reason for hiding this comment

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

Same as permittedDangerousGoodsEnum case

@@ -36,8 +114,8 @@ export interface ApplicantDetails {
}

export interface AdditionalNotes {
number?: string[];
guidanceNotes?: string[];
number?: additionalNotesNumberEnum[];

Choose a reason for hiding this comment

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

ADR documentation states that this shouldn't be an enum in the backend due to the historic data containing erroneous values

Copy link
Author

Choose a reason for hiding this comment

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

Same as permittedDangerousGoodsEnum case

applicantDetails?: ApplicantDetails;
memosApply?: string[];
dangerousGoods?: boolean;

Choose a reason for hiding this comment

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

This is not required as it is a front end field for UX

Copy link
Author

@meys-bjss meys-bjss Feb 8, 2024

Choose a reason for hiding this comment

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

Same as newCertificateRequested case

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