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

SSCSCI-1137 - Update Docmosis address logic #4093

Merged
merged 22 commits into from
Nov 11, 2024
Merged

SSCSCI-1137 - Update Docmosis address logic #4093

merged 22 commits into from
Nov 11, 2024

Conversation

Ziziou91
Copy link
Contributor

@Ziziou91 Ziziou91 commented Oct 28, 2024

SSCSCI-1137 - Update Docmosis address logic for international addresses

Jira link

https://tools.hmcts.net/jira/browse/SSCSCI-1137

Change description

Move labels() to LetterUtils.java and add conditional logic to handle international addresses.

Write unit tests for labels() in LetterUtilsTest.java.

Implement labels() in following files to allow them to handle international addresses:

  • PlaceholderService.java
  • PdfLetterService.java
  • SendNotificationService.java
  • GenericLetterPlaceholderService.java
  • PlaceholderUtility.java

Testing done

Unit tests in LetterUtilsTest.java.

Checklist

  • [ x] commit messages are meaningful and follow good commit message guidelines
  • [ x] README and other documentation has been updated / added (if needed)
  • [ x] tests have been updated / new tests has been added (if needed)
  • Does this PR introduce a breaking change

…tes. Update references to new TB-SCS-LET-ENG-Appeal-Lodged-Representative-IB template.
@Ziziou91 Ziziou91 requested a review from a team as a code owner October 28, 2024 13:17
Copy link

CCD diff report

No change

…tes. Update references to new TB-SCS-LET-ENG-Appeal-Lodged-Representative-IB template.
Copy link
Contributor

Choose a reason for hiding this comment

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

is this needed? Can it be deleted?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks for flagging. Wasn't needed and has been removed.

dump.rdb Outdated
Copy link
Contributor

Choose a reason for hiding this comment

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

is this needed? Can it be deleted?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks for flagging. Wasn't needed and has been deleted.

nilay913
nilay913 previously approved these changes Oct 29, 2024
linusnorton
linusnorton previously approved these changes Nov 7, 2024
@benouaer
Copy link
Contributor

benouaer commented Nov 8, 2024

what is this cftlib_log_file_IS_UNDEFINED?

@@ -4,9 +4,10 @@
import static org.apache.commons.lang3.StringUtils.isNoneBlank;
import static uk.gov.hmcts.reform.sscs.ccd.domain.YesNo.isYes;
import static uk.gov.hmcts.reform.sscs.evidenceshare.service.placeholders.PlaceholderConstants.*;
Copy link
Contributor

Choose a reason for hiding this comment

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

hmcts style guidelines recommend not using wildcard imports


for (int i = 0; i < lines.size(); i++) {
Copy link
Contributor

Choose a reason for hiding this comment

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

given that this same logic is repeated for most calls to lines(), is it worth incorporating it into the method (or creating a separate method that calls it), and passing a boolean to decide whether or not to truncate

@Ziziou91
Copy link
Contributor Author

Ziziou91 commented Nov 8, 2024

what is this cftlib_log_file_IS_UNDEFINED?

@benouaer looks like it's being produced in directory tests are run from when a CCD test fails. See createPropertiesFolder method below:
https://github.com/hmcts/rse-cft-lib/blob/main/cftlib/lib/bootstrapper/src/main/java/uk/gov/hmcts/rse/ccd/lib/LibRunner.java

File deleted.

@@ -404,4 +416,8 @@ private static String getDocumentForType(AbstractDocument sscsDocument) {
return null;
}

private static String defaultToEmptyStringIfNull(String value) {
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 be in letterUtils?

benouaer
benouaer previously approved these changes Nov 8, 2024
.gitignore Show resolved Hide resolved
@Ziziou91 Ziziou91 merged commit 20c0216 into master Nov 11, 2024
8 checks passed
@Ziziou91 Ziziou91 deleted the SSCSCI-1137 branch November 11, 2024 19:23
linusnorton added a commit that referenced this pull request Nov 12, 2024
linusnorton added a commit that referenced this pull request Nov 12, 2024
linusnorton added a commit that referenced this pull request Nov 12, 2024
linusnorton added a commit that referenced this pull request Dec 13, 2024
* Reapply "SSCSCI-1137 - Update Docmosis address logic (#4093)" (#4131)

This reverts commit 0ea1d68.

* refactor getAddressPlaceholders to validate letter service.

* Update .gitignore

* Allow addresses without postcode outside UK

* Allow blank postcode on international addresses

* SSCSCI-1473 bug fix to pass international postcode through from SYA

* SSCSCI-1473 test

* pointing to SYA PR

* fix coverletter addresses

* Merge master

* Fix test

* repoint before merge

---------

Co-authored-by: Joshua Gray <joshgray91@gmail.com>
Co-authored-by: nilay <nilay.patel@hmcts.net>
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.

5 participants