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

Address bug issue #213

Open
wants to merge 16 commits into
base: main
Choose a base branch
from
Open

Address bug issue #213

wants to merge 16 commits into from

Conversation

hemerem-ch
Copy link
Contributor

-fix address bug (save session and carry over)
-added service layers

@ch-code-analysis
Copy link

CI: No security warnings found


}
const selectPremise = req.body.correspondenceAddress;
Copy link
Contributor

Choose a reason for hiding this comment

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

should this const be called as correspondenceAddress instead of premise?


}
const selectPremise = req.body.correspondenceAddress;
CorrespondenceAddressDetailsService.saveCorrespondenceDetailsAddress(req, acspData, selectPremise);
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we not have to create an object of the service class first and then call the function?

const { firstName, lastName, addresses } = acspData;

/* const acspData : ACSPData = session?.getExtraData(USER_DATA)!;
Copy link
Contributor

Choose a reason for hiding this comment

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

This commented out code can be removed.

throw new Error("Method not implemented.");
}

static saveCorrespondenceAddressToSession (session: Session, req: Request, ukAddresses: UKAddress[], inputPremise: string): void {
Copy link
Contributor

Choose a reason for hiding this comment

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

no need to create static methods.

@ch-code-analysis
Copy link

CI: No security warnings found

saveDataInSession(req, USER_DATA, acspData);
res.redirect(BASE_URL + SOLE_TRADER_CORRESPONDENCE_ADDRESS_CONFIRM);
const autoLookupSessionservice = new CorrespondenceAddressAutoLookService();
autoLookupSessionservice.saveCorrespondenceAddressToSession(acspData, req, ukAddresses, correspondencePremise);
Copy link
Contributor

Choose a reason for hiding this comment

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

saveCorrespondenceAddress is enough no need to add "ToSession" in the name

saveDataInSession(req, USER_DATA, acspData);
res.redirect(BASE_URL + SOLE_TRADER_CORRESPONDENCE_ADDRESS_CONFIRM);
const AddressManualservice = new CorrespondenceAddressManualService();
AddressManualservice.saveCorrespondenceManualAddress(req, acspData);
Copy link
Contributor

Choose a reason for hiding this comment

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

variable name needs to follow camel casing

@ch-code-analysis
Copy link

CI: No security warnings found

@ch-code-analysis
Copy link

CI: No security warnings found

2 similar comments
@ch-code-analysis
Copy link

CI: No security warnings found

@ch-code-analysis
Copy link

CI: No security warnings found

country: getCountryFromKey(ukAddress.country),
postcode: ukAddress.postcode
};
}
Copy link
Contributor

Choose a reason for hiding this comment

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

you can break out of the loop once the match is found

Copy link
Contributor

Choose a reason for hiding this comment

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

There is no difference between address and correspondenceAddress. Only one can be used

@ch-code-analysis
Copy link

CI: No security warnings found

if (ukAddress.premise === inputPremise) {
const correspondenceAddress: Address = {
propertyDetails: ukAddress.premise,
// premise: ukAddress.premise,
Copy link
Contributor

@sampankumar sampankumar Mar 27, 2024

Choose a reason for hiding this comment

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

you can remove this commented code.

export class CorrespondenceAddressAutoLookService {
saveCorrespondenceAddress (acspData :ACSPData, ukAddresses: UKAddress[], inputPremise: string): ACSPData {

const address = {
Copy link
Contributor

Choose a reason for hiding this comment

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

Do you need this anymore?

@ch-code-analysis
Copy link

CI: No security warnings found

@ch-code-analysis
Copy link

CI: No security warnings found

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