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

Notifications review contacts formatting #1652

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

jonathangoulding
Copy link
Collaborator

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.

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.
@jonathangoulding jonathangoulding self-assigned this Jan 24, 2025
@jonathangoulding jonathangoulding added the enhancement New feature or request label Jan 24, 2025
@@ -0,0 +1,69 @@
function _licenceContactAddress(contact) {
const contactAddressFields = [
Copy link
Collaborator Author

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')
Copy link
Collaborator Author

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(
Copy link
Collaborator Author

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,
Copy link
Collaborator Author

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)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant