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

Dfr 2689 auto date pension sharing annex #1944

Open
wants to merge 45 commits into
base: master
Choose a base branch
from

Conversation

dawudgovuk
Copy link
Contributor

Jira link

https://tools.hmcts.net/jira/browse/DFR-2689

Change description

Auto date document - pension sharing annex

@hmcts-jenkins-d-to-i
Copy link
Contributor

Plan Result (aat)

No changes. Your infrastructure matches the configuration.

@hmcts-jenkins-d-to-i
Copy link
Contributor

Plan Result (prod)

No changes. Your infrastructure matches the configuration.

&& (acroForm.get().getField(FORM_P1_DATE_OF_ORDER_TEXTBOX_NAME) instanceof PDTextField)) {
PDField field = acroForm.get().getField(FORM_P1_DATE_OF_ORDER_TEXTBOX_NAME);
PDTextField textBox = (PDTextField) field;
textBox.setDefaultAppearance("/Helv 12 Tf 0 g");
Copy link
Contributor

@al-hmcts al-hmcts Nov 13, 2024

Choose a reason for hiding this comment

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

Are we sure we want to add this font in? Can we not used any embedded font, we saw on the D11 that this font was marked as not embedded on the pre-flight tool. Could we use a font already on the PDF?

@@ -132,4 +133,25 @@ private Boolean isPensionDocumentsEmpty(Map<String, Object> caseData) {
List<CaseDocument> pensionDocumentsData = documentHelper.getPensionDocumentsData(caseData);
return pensionDocumentsData.isEmpty();
}

private static LocalDate getApprovalDate(Map<String, Object> caseData) {
Copy link
Contributor

Choose a reason for hiding this comment

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

This method doesn't need to be static

try {
return LocalDate.parse((String) value);
} catch (Exception e) {
log.info("Invalid Approved date of order for key '" + caseData + "': " + e.getMessage());
Copy link
Contributor

Choose a reason for hiding this comment

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

It looks like you are outputting the whole caseData map in the log message. Is this a good idea? Same comment for line 153

}
}

private void verifyNoDateOfOrderField(byte[] bytes) throws IOException {
Copy link
Contributor

Choose a reason for hiding this comment

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

The last two methods aren't being used. They should be removed.

}

private void verifyDateOfOrderField(byte[] bytes) throws IOException {
try (PDDocument document = Loader.loadPDF(bytes)) {
Copy link
Contributor

Choose a reason for hiding this comment

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

SonarLint complains about "document" in the IDE:
Rename "document" which hides the field declared at line 51.

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.

4 participants