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

NFDIV-4420 - Invite citizen when solicitor stops representation #4251

Open
wants to merge 10 commits into
base: NFDIV-4355-backend
Choose a base branch
from

Conversation

pallavijustice
Copy link
Contributor

Change description

When a solicitor has stopped representation (NFDIV-4234), then system must invite the citizen to the case by sending them letter and an email (if email address available). This is only for SOLE cases. Changes for NFDIV-4234 has been included in this PR to build this PR. on top of NFDIV-4355.

JIRA link (if applicable)

https://tools.hmcts.net/jira/browse/NFDIV-4420

Comment on lines 150 to 158
notificationDispatcher.sendNOC(nocSolRemovedSelfNotifications, details.getData(),
beforeDetails.getData(), details.getId(), wasRepresentingApplicant1, NoticeType.ORG_REMOVED);

if (data.getApplicationType() == ApplicationType.SOLE_APPLICATION) {
final var applicant = wasRepresentingApplicant1 ? data.getApplicant1() : data.getApplicant2();
generateCaseInvite(data, wasRepresentingApplicant1, applicant);
notificationDispatcher.sendNOCCaseInvite(nocSolRemovedSelfNotifications, details.getData(), details.getId(),
wasRepresentingApplicant1);
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

If I'm not mistaken, across the NoC events (caseworkerNoticeOfChange, solicitorStopRepresentingClient), we send the case invite whenever the notice type is ORG_REMOVED and the application type is sole. As most of the logic for NoC notifications is in sendNOC, I'm thinking about whether it would be beneficial to remove sendNOCCaseInvite and move the logic for the case invite notification into the sendNOC method, allowing us consolidate the notification logic into 1 method and remove duplication from the NoC events?

Suggested change
notificationDispatcher.sendNOC(nocSolRemovedSelfNotifications, details.getData(),
beforeDetails.getData(), details.getId(), wasRepresentingApplicant1, NoticeType.ORG_REMOVED);
if (data.getApplicationType() == ApplicationType.SOLE_APPLICATION) {
final var applicant = wasRepresentingApplicant1 ? data.getApplicant1() : data.getApplicant2();
generateCaseInvite(data, wasRepresentingApplicant1, applicant);
notificationDispatcher.sendNOCCaseInvite(nocSolRemovedSelfNotifications, details.getData(), details.getId(),
wasRepresentingApplicant1);
}
notificationDispatcher.sendNOC(nocSolRemovedSelfNotifications, details.getData(),
beforeDetails.getData(), details.getId(), wasRepresentingApplicant1, NoticeType.ORG_REMOVED);

@hmcts-jenkins-j-to-z
Copy link
Contributor

Plan Result (aat)

No changes. Your infrastructure matches the configuration.

@hmcts-jenkins-j-to-z
Copy link
Contributor

Plan Result (prod)

No changes. Your infrastructure matches the configuration.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants