-
Notifications
You must be signed in to change notification settings - Fork 0
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
Notifications review contacts formatting #1652
base: main
Are you sure you want to change the base?
Notifications review contacts formatting #1652
Conversation
https://eaflood.atlassian.net/browse/WATER-4775 Previous work has been done to add the initial page, controller and router for the notification review page. This change refactors the existing licence contact document header contact formatting into a shared presenter. The notifications contact column will use this logic to give a consistent representation of the contact details to the user.
@@ -0,0 +1,69 @@ | |||
function _licenceContactAddress(contact) { | |||
const contactAddressFields = [ |
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.
this needs testing
@@ -17,6 +17,7 @@ const { db } = require('../../../../db/db.js') | |||
*/ | |||
async function go(dueDate, summer) { | |||
const { rows } = await _fetch(dueDate, summer) | |||
// const { rows } = await _fetch('2024-11-28', 'true') |
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.
make sure to remove
function _duplicateLicenceHolderAndReturnsToContact(acc, obj) { | ||
const recipient = [acc[obj.contact_hash_id], obj].find((rec) => rec.message_type === 'Letter - licence holder') | ||
const recipients = [acc[obj.contact_hash_id], obj].filter( |
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.
This assumes possible multiple licence holder and returns to having multiple types.
@@ -84,8 +85,7 @@ FROM ( | |||
ELSE 'Letter - returns to' | |||
END) AS message_type, | |||
(NULL) AS recipient, | |||
LOWER( concat_ws(',', contacts->>'salutation', contacts->>'forename', contacts->>'initials', contacts->>'name', contacts->>'addressLine1', contacts->>'addressLine2', contacts->>'addressLine3', contacts->>'addressLine4', contacts->>'town', contacts->>'county', contacts->>'postcode', contacts->>'country')) | |||
AS contact, | |||
contacts as contact, |
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.
Seeing issues with some fields not being lowercased and showing as duplicates then they are (when lowercased properly)
https://eaflood.atlassian.net/browse/WATER-4775
Previous work has been done to add the initial page, controller and router for the notification review page.
This change refactors the existing licence contact document header contact formatting into a shared presenter.
The notifications contact column will use this logic to give a consistent representation of the contact details to the user.