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

SRU2024 v9.5 #113

Merged
merged 22 commits into from
Nov 19, 2024
Merged

SRU2024 v9.5 #113

merged 22 commits into from
Nov 19, 2024

Conversation

zubri
Copy link
Member

@zubri zubri commented Apr 27, 2024

Summary by CodeRabbit

  • New Features

    • Enhanced message handling to support SWIFT Standard 2024 and standard envelopes.
    • Introduced message categories for better organization.
    • Added support for Business Application Header version 4.
  • Improvements

    • Enhanced message identification with updates to the message handling components.
    • Added a business service field for message type differentiation.
    • Streamlined XML serialization with improved handling of envelope types.
    • Enhanced parsing logic for different versions of the Business Application Header.
  • Dependency Updates

    • Updated libraries for enhanced performance and security.
  • Bug Fixes

    • Addressed a Null Pointer Exception in metadata handling.
    • Corrected UTC offset conversion in date and time handling.

Copy link
Contributor

coderabbitai bot commented Jun 28, 2024

Warning

Rate limit exceeded

@zubri has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 18 minutes and 52 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

📥 Commits

Reviewing files that changed from the base of the PR and between fdf3346 and 7127e72.

📝 Walkthrough

Walkthrough

The updates introduce significant enhancements to the Prowide ISO 20022 library, aligning it with the SWIFT Standard 2024. Key improvements include better handling of business services, the introduction of new message categories, and support for standard envelopes. Critical fixes, particularly addressing null pointer exceptions, bolster application robustness. Additionally, the library's dependencies have been updated to ensure improved performance and security.

Changes

File Change Summary
CHANGELOG.md Overview of updates from version 9.4.6 to 9.5.4, including fixes, enhancements, and dependency updates.
AppHdrFactory.java, MxParseUtils.java Enhanced to respect business services in message identification and header creation.
MxWriteConfiguration.java Added support for standard envelopes for SWIFT and ISO 20022, with improved configuration handling.
MxId.java Introduced optional businessService field for message type differentiation.
AbstractMX.java Deprecated methods and constants, refined XML serialization logic for better clarity and flexibility.
AppHdrParser.java Expanded parsing logic to support multiple versions of Business Application Header.
Dependencies Updated commons-lang3 to version 3.14.0 and gson to version 2.11.0 for enhanced performance and security.

Sequence Diagram(s)

sequenceDiagram
    actor User
    participant AppHdrFactory
    participant MxParseUtils
    participant MxId
    User->>AppHdrFactory: Create Header with Business Service
    AppHdrFactory->>MxId: Initialize with Business Service
    User->>MxParseUtils: Identify Message
    MxParseUtils->>MxId: Set Business Service
Loading

Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 7

Outside diff range comments (2)
build.gradle (1)

Line range hint 209-225: Ensure correct envelope type property name in configuration.

The property envelopeTyoe is likely a typo and should be envelopeType. This could lead to runtime errors if the property is accessed incorrectly.

- conf.envelopeTyoe = EnvelopeType.SWIFT;
+ conf.envelopeType = EnvelopeType.SWIFT;
iso20022-core/src/main/java/com/prowidesoftware/swift/model/mx/AbstractMX.java (1)

Line range hint 231-310: Optimize the XML serialization logic for clarity and efficiency.

The method message(MxWriteConfiguration) contains complex logic for XML serialization, including conditional checks for envelope types and prefixes. This could be refactored for better clarity and possibly improved efficiency by extracting some logic into smaller, more focused methods.

- if (envelope.name().startsWith("BME")) {
+ if (isBMEEvelope(envelope)) {

And add a new method:

private boolean isBMEEvelope(EnvelopeType envelope) {
    return envelope.name().startsWith("BME");
}

Comment on lines +117 to +169

@Test
public void testWriteWithDefaultOptions() {
final MxPacs00800110 mx = new MxPacs00800110();
mx.setAppHdr(new BusinessAppHdrV02());
mx.setFIToFICstmrCdtTrf(new FIToFICustomerCreditTransferV10());
mx.getFIToFICstmrCdtTrf().setGrpHdr(new GroupHeader96());
mx.getFIToFICstmrCdtTrf().getGrpHdr().setMsgId("123");

final String xml = mx.message();

final String expected = "<?xml version=\"1.0\" encoding=\"UTF-8\" ?>\n" + "<RequestPayload>\n"
+ "<head:AppHdr xmlns:head=\"urn:iso:std:iso:20022:tech:xsd:head.001.001.02\"></head:AppHdr>\n"
+ "<pacs:Document xmlns:pacs=\"urn:iso:std:iso:20022:tech:xsd:pacs.008.001.10\">\n"
+ " <pacs:FIToFICstmrCdtTrf>\n"
+ " <pacs:GrpHdr>\n"
+ " <pacs:MsgId>123</pacs:MsgId>\n"
+ " </pacs:GrpHdr>\n"
+ " </pacs:FIToFICstmrCdtTrf>\n"
+ "</pacs:Document>\n"
+ "</RequestPayload>";
assertEquals(expected, xml);
}

@Test
public void testWriteWithCustomOptions() {
final MxPacs00800110 mx = new MxPacs00800110();
mx.setAppHdr(new BusinessAppHdrV02());
mx.setFIToFICstmrCdtTrf(new FIToFICustomerCreditTransferV10());
mx.getFIToFICstmrCdtTrf().setGrpHdr(new GroupHeader96());
mx.getFIToFICstmrCdtTrf().getGrpHdr().setMsgId("123");

MxWriteConfiguration conf = new MxWriteConfiguration();
conf.includeXMLDeclaration = false;
conf.rootElement = "Message";
conf.headerPrefix = "Head";
conf.documentPrefix = "Doc";
conf.useCategoryAsDocumentPrefix = false;

final String xml = mx.message(conf);

final String expected = "<Message>\n"
+ "<Head:AppHdr xmlns:Head=\"urn:iso:std:iso:20022:tech:xsd:head.001.001.02\"></Head:AppHdr>\n"
+ "<Doc:Document xmlns:Doc=\"urn:iso:std:iso:20022:tech:xsd:pacs.008.001.10\">\n"
+ " <Doc:FIToFICstmrCdtTrf>\n"
+ " <Doc:GrpHdr>\n"
+ " <Doc:MsgId>123</Doc:MsgId>\n"
+ " </Doc:GrpHdr>\n"
+ " </Doc:FIToFICstmrCdtTrf>\n"
+ "</Doc:Document>\n"
+ "</Message>";
assertEquals(expected, xml);
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Consider using more robust XML testing methods.

The current tests check for substrings in the XML output, which can be error-prone and may not catch structural issues. Consider using an XML comparison tool or library to ensure the XML structure is correct, not just the presence of certain strings.

@zubri zubri changed the title SRU2024 SRU2024 v9.5 Jun 29, 2024
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 4

Outside diff range comments (2)
CHANGELOG.md (1)

Line range hint 134-134: Fix the hyphenation issue.

Use a hyphen in "interface-based".

-  * Added a new extensible interface based model for the application headers: AppHdr
+  * Added a new extensible interface-based model for the application headers: AppHdr
Tools
Markdownlint

3-3: Expected: h2; Actual: h4
Heading levels should only increment by one level at a time

(MD001, heading-increment)


4-4: Expected: 0; Actual: 2
Unordered list indentation

(MD007, ul-indent)


7-7: Expected: 0; Actual: 2
Unordered list indentation

(MD007, ul-indent)


8-8: Expected: 0; Actual: 2
Unordered list indentation

(MD007, ul-indent)


11-11: Expected: 0; Actual: 2
Unordered list indentation

(MD007, ul-indent)


12-12: Expected: 0; Actual: 2
Unordered list indentation

(MD007, ul-indent)


13-13: Expected: 0; Actual: 2
Unordered list indentation

(MD007, ul-indent)


14-14: Expected: 0; Actual: 2
Unordered list indentation

(MD007, ul-indent)


15-15: Expected: 0; Actual: 2
Unordered list indentation

(MD007, ul-indent)


16-16: Expected: 0; Actual: 2
Unordered list indentation

(MD007, ul-indent)


17-17: Expected: 0; Actual: 2
Unordered list indentation

(MD007, ul-indent)


18-18: Expected: 0; Actual: 2
Unordered list indentation

(MD007, ul-indent)


21-21: Expected: 0; Actual: 2
Unordered list indentation

(MD007, ul-indent)


22-22: Expected: 0 or 2; Actual: 1
Trailing spaces

(MD009, no-trailing-spaces)


3-3: Expected: 1; Actual: 0; Below
Headings should be surrounded by blank lines

(MD022, blanks-around-headings)


6-6: Expected: 1; Actual: 0; Below
Headings should be surrounded by blank lines

(MD022, blanks-around-headings)


10-10: Expected: 1; Actual: 0; Below
Headings should be surrounded by blank lines

(MD022, blanks-around-headings)


20-20: Expected: 1; Actual: 0; Below
Headings should be surrounded by blank lines

(MD022, blanks-around-headings)


4-4: null
Lists should be surrounded by blank lines

(MD032, blanks-around-lists)


7-7: null
Lists should be surrounded by blank lines

(MD032, blanks-around-lists)


11-11: null
Lists should be surrounded by blank lines

(MD032, blanks-around-lists)


21-21: null
Lists should be surrounded by blank lines

(MD032, blanks-around-lists)


12-12: null
Bare URL used

(MD034, no-bare-urls)

build.gradle (1)

Line range hint 99-100: Standardize Dependency Versions

Multiple versions of the same dependency are declared. To avoid potential conflicts and ensure consistency, standardize the versions of the following dependencies:

  • org.apache.commons:commons-lang3
    • Versions found: 3.12.0, 3.14.0
  • com.google.code.gson:gson
    • Versions found: 2.9.0, 2.11.0
-  implementation 'org.apache.commons:commons-lang3:3.12.0'
-  implementation 'com.google.code.gson:gson:2.9.0'
+  implementation 'org.apache.commons:commons-lang3:3.14.0'
+  implementation 'com.google.code.gson:gson:2.11.0'

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 4

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 3

Comment on lines +10 to +19
#### 9.5.0 - May 2024
* SWIFT Standard release update 2024 (live 16 November 2024)
* Yearly revision of deprecation phase (see https://dev.prowidesoftware.com/SRU2024/getting-started/deprecation/)
* Added message categories for File Management (cafm), Fraud Reporting and Disposition (cafm), Network Management (canm), and Settlement Reporting (casr)
* Add support in the MxWriteConfiguration to use standard envelopes for SWIFT and ISO 20022
* Changed the default Document prefix to the message category; "camt", "pacs", etc...
* Enhanced MxId with optional and transient businessService field to act as a message type discriminator
* Dependency update: commons-lang3 -> 3.14.0
* Dependency update: gson -> 2.11.0

Copy link
Contributor

Choose a reason for hiding this comment

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

Fix the bare URL and grammatical errors.

Replace the bare URL with a proper markdown link and fix the colon usage before the list.

-  * Yearly revision of deprecation phase (see https://dev.prowidesoftware.com/SRU2024/getting-started/deprecation/)
+  * Yearly revision of deprecation phase ([see here](https://dev.prowidesoftware.com/SRU2024/getting-started/deprecation/))

-  * Added message categories for File Management (cafm), Fraud Reporting and Disposition (cafm), Network Management (canm) and Settlement Reporting (casr)
+  * Added message categories for File Management (cafm), Fraud Reporting and Disposition (cafm), Network Management (canm), and Settlement Reporting (casr)
Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
#### 9.5.0 - May 2024
* SWIFT Standard release update 2024 (live 16 November 2024)
* Yearly revision of deprecation phase (see https://dev.prowidesoftware.com/SRU2024/getting-started/deprecation/)
* Added message categories for File Management (cafm), Fraud Reporting and Disposition (cafm), Network Management (canm), and Settlement Reporting (casr)
* Add support in the MxWriteConfiguration to use standard envelopes for SWIFT and ISO 20022
* Changed the default Document prefix to the message category; "camt", "pacs", etc...
* Enhanced MxId with optional and transient businessService field to act as a message type discriminator
* Dependency update: commons-lang3 -> 3.14.0
* Dependency update: gson -> 2.11.0
#### 9.5.0 - May 2024
* SWIFT Standard release update 2024 (live 16 November 2024)
* Yearly revision of deprecation phase ([see here](https://dev.prowidesoftware.com/SRU2024/getting-started/deprecation/))
* Added message categories for File Management (cafm), Fraud Reporting and Disposition (cafm), Network Management (canm), and Settlement Reporting (casr)
* Add support in the MxWriteConfiguration to use standard envelopes for SWIFT and ISO 20022
* Changed the default Document prefix to the message category; "camt", "pacs", etc...
* Enhanced MxId with optional and transient businessService field to act as a message type discriminator
* Dependency update: commons-lang3 -> 3.14.0
* Dependency update: gson -> 2.11.0
Tools
Markdownlint

11-11: Expected: 0; Actual: 2
Unordered list indentation

(MD007, ul-indent)


12-12: Expected: 0; Actual: 2
Unordered list indentation

(MD007, ul-indent)


13-13: Expected: 0; Actual: 2
Unordered list indentation

(MD007, ul-indent)


14-14: Expected: 0; Actual: 2
Unordered list indentation

(MD007, ul-indent)


15-15: Expected: 0; Actual: 2
Unordered list indentation

(MD007, ul-indent)


16-16: Expected: 0; Actual: 2
Unordered list indentation

(MD007, ul-indent)


17-17: Expected: 0; Actual: 2
Unordered list indentation

(MD007, ul-indent)


18-18: Expected: 0; Actual: 2
Unordered list indentation

(MD007, ul-indent)


10-10: Expected: 1; Actual: 0; Below
Headings should be surrounded by blank lines

(MD022, blanks-around-headings)


11-11: null
Lists should be surrounded by blank lines

(MD032, blanks-around-lists)


12-12: null
Bare URL used

(MD034, no-bare-urls)

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 8

#### 9.5.0 - May 2024
* SWIFT Standard release update 2024 (live 16 November 2024)
* Yearly revision of deprecation phase (see https://dev.prowidesoftware.com/SRU2024/getting-started/deprecation/)
* Added message categories for File Management (cafm), Fraud Reporting and Disposition (cafm), Network Management (canm), and Settlement Reporting (casr)
Copy link
Contributor

Choose a reason for hiding this comment

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

Fix the colon usage.

Do not use a colon before a series introduced by a preposition.

-  * Added message categories for File Management (cafm), Fraud Reporting and Disposition (cafm), Network Management (canm), and Settlement Reporting (casr)
+  * Added message categories for File Management (cafm), Fraud Reporting and Disposition (cafm), Network Management (canm), and Settlement Reporting (casr)

Committable suggestion was skipped due to low confidence.

Tools
Markdownlint

16-16: Expected: 0; Actual: 2
Unordered list indentation

(MD007, ul-indent)


#### 9.5.0 - May 2024
* SWIFT Standard release update 2024 (live 16 November 2024)
* Yearly revision of deprecation phase (see https://dev.prowidesoftware.com/SRU2024/getting-started/deprecation/)
Copy link
Contributor

Choose a reason for hiding this comment

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

Fix the bare URL usage.

Replace the bare URL with a proper markdown link.

-  * Yearly revision of deprecation phase (see https://dev.prowidesoftware.com/SRU2024/getting-started/deprecation/)
+  * Yearly revision of deprecation phase ([see here](https://dev.prowidesoftware.com/SRU2024/getting-started/deprecation/))
Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
* Yearly revision of deprecation phase (see https://dev.prowidesoftware.com/SRU2024/getting-started/deprecation/)
* Yearly revision of deprecation phase ([see here](https://dev.prowidesoftware.com/SRU2024/getting-started/deprecation/))
Tools
Markdownlint

15-15: Expected: 0; Actual: 2
Unordered list indentation

(MD007, ul-indent)


15-15: null
Bare URL used

(MD034, no-bare-urls)

CHANGELOG.md Outdated
@@ -1,8 +1,25 @@
# Prowide ISO 20022 - CHANGELOG

#### 9.4.6 - May 2024
#### 9.5.3 - SNAPSHOT
Copy link
Contributor

Choose a reason for hiding this comment

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

Fix the heading level issue.

Ensure that the heading levels only increment by one level at a time.

-#### 9.5.3 - SNAPSHOT
+## 9.5.3 - SNAPSHOT
Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
#### 9.5.3 - SNAPSHOT
## 9.5.3 - SNAPSHOT
Tools
Markdownlint

3-3: Expected: h2; Actual: h4
Heading levels should only increment by one level at a time

(MD001, heading-increment)


3-3: Expected: 1; Actual: 0; Below
Headings should be surrounded by blank lines

(MD022, blanks-around-headings)

@@ -1,8 +1,25 @@
# Prowide ISO 20022 - CHANGELOG

#### 9.4.6 - May 2024
#### 9.5.3 - SNAPSHOT
* (PW-1947) Updated MX model with latest SWIFT SRU2024 schema update, including new messages such as trck.001.001.03
Copy link
Contributor

Choose a reason for hiding this comment

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

Fix the unordered list indentation.

Ensure the unordered list items are correctly indented.

-  * (PW-1947) Updated MX model with latest SWIFT SRU2024 schema update, including new messages such as trck.001.001.03
+* (PW-1947) Updated MX model with latest SWIFT SRU2024 schema update, including new messages such as trck.001.001.03
Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
* (PW-1947) Updated MX model with latest SWIFT SRU2024 schema update, including new messages such as trck.001.001.03
* (PW-1947) Updated MX model with latest SWIFT SRU2024 schema update, including new messages such as trck.001.001.03
Tools
Markdownlint

4-4: Expected: 0; Actual: 2
Unordered list indentation

(MD007, ul-indent)


4-4: null
Lists should be surrounded by blank lines

(MD032, blanks-around-lists)

Comment on lines +17 to +21
* Add support in the MxWriteConfiguration to use standard envelopes for SWIFT and ISO 20022
* Changed the default Document prefix to the message category; "camt", "pacs", etc...
* Enhanced MxId with optional and transient businessService field to act as a message type discriminator
* Dependency update: commons-lang3 -> 3.14.0
* Dependency update: gson -> 2.11.0
Copy link
Contributor

Choose a reason for hiding this comment

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

Fix the indentation issue.

Ensure the unordered list items are correctly indented.

-  * Add support in the MxWriteConfiguration to use standard envelopes for SWIFT and ISO 20022
-  * Changed the default Document prefix to the message category; "camt", "pacs", etc...
-  * Enhanced MxId with optional and transient businessService field to act as a message type discriminator
-  * Dependency update: commons-lang3 -> 3.14.0
-  * Dependency update: gson -> 2.11.0
+* Add support in the MxWriteConfiguration to use standard envelopes for SWIFT and ISO 20022
+* Changed the default Document prefix to the message category; "camt", "pacs", etc...
+* Enhanced MxId with optional and transient businessService field to act as a message type discriminator
+* Dependency update: commons-lang3 -> 3.14.0
+* Dependency update: gson -> 2.11.0
Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
* Add support in the MxWriteConfiguration to use standard envelopes for SWIFT and ISO 20022
* Changed the default Document prefix to the message category; "camt", "pacs", etc...
* Enhanced MxId with optional and transient businessService field to act as a message type discriminator
* Dependency update: commons-lang3 -> 3.14.0
* Dependency update: gson -> 2.11.0
* Add support in the MxWriteConfiguration to use standard envelopes for SWIFT and ISO 20022
* Changed the default Document prefix to the message category; "camt", "pacs", etc...
* Enhanced MxId with optional and transient businessService field to act as a message type discriminator
* Dependency update: commons-lang3 -> 3.14.0
* Dependency update: gson -> 2.11.0
Tools
Markdownlint

17-17: Expected: 0; Actual: 2
Unordered list indentation

(MD007, ul-indent)


18-18: Expected: 0; Actual: 2
Unordered list indentation

(MD007, ul-indent)


19-19: Expected: 0; Actual: 2
Unordered list indentation

(MD007, ul-indent)


20-20: Expected: 0; Actual: 2
Unordered list indentation

(MD007, ul-indent)


21-21: Expected: 0; Actual: 2
Unordered list indentation

(MD007, ul-indent)

Comment on lines +68 to +73
private static final Logger log = Logger.getLogger(AbstractMX.class.getName());
/**
* Default root element when an MX is serialized as XML including both AppHdr and Document
*
* @since 8.0.2
* @deprecated the default root element for the custom envelope is now defined in {@link EnvelopeType#CUSTOM}
*/
@Deprecated
@ProwideDeprecated(phase2 = TargetYear.SRU2025)
Copy link
Contributor

Choose a reason for hiding this comment

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

Consider revising the deprecation phase for DEFAULT_ROOT_ELEMENT.

The DEFAULT_ROOT_ELEMENT is now deprecated with a phase2 target of SRU2025. Given that this is a widely used constant, consider extending the deprecation phase to allow more time for migration.

/**
* Parses the XML string containing the Document and optional AppHdr into a specific instance of MX message object.
* The message and header types and version is auto detected.
* The message and header types and version is auto-detected.
Copy link
Contributor

Choose a reason for hiding this comment

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

Review deprecation strategy and ensure consistency.

Several methods such as parse(File, MxId), write(File), and write(OutputStream) are marked for deprecation by SRU2025 with a recommendation to use alternatives. Ensure that all recommended alternatives are documented clearly and consider providing examples in the deprecation annotations to aid the transition.

Comment on lines +133 to +135
@ProwideDeprecated(phase4 = TargetYear.SRU2025)
public static AbstractMX parse(final File file, MxId id) throws IOException {
DeprecationUtils.phase2(
DeprecationUtils.phase3(
Copy link
Contributor

Choose a reason for hiding this comment

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

Ensure clear recommendation in deprecation annotation.

The method parse(File, MxId) is marked for deprecation. Ensure that the deprecation annotation includes a clear recommendation for the alternative method to use.

- @ProwideDeprecated(phase4 = TargetYear.SRU2025)
+ @ProwideDeprecated(phase4 = TargetYear.SRU2025, alternative = "Lib.readFile(file) and any parse from String method")
Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
@ProwideDeprecated(phase4 = TargetYear.SRU2025)
public static AbstractMX parse(final File file, MxId id) throws IOException {
DeprecationUtils.phase2(
DeprecationUtils.phase3(
@ProwideDeprecated(phase4 = TargetYear.SRU2025, alternative = "Lib.readFile(file) and any parse from String method")
public static AbstractMX parse(final File file, MxId id) throws IOException {
DeprecationUtils.phase3(

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 7

Comment on lines +10 to +113
+ "<RequestPayload>"
+ "<h:AppHdr xmlns:h=\"urn:swift:xsd:$ahV10\">"
+ " <h:From>"
+ " <h:Type>BIC</h:Type>"
+ " <h:Id>AAAANGL0XXX</h:Id>"
+ " </h:From>"
+ " <h:To>"
+ " <h:Type>BIC</h:Type>"
+ " <h:Id>BBBBUS33XXX</h:Id>"
+ " </h:To>"
+ " <h:MsgName>pacs.008.001.08</h:MsgName>"
+ " <h:MsgRef>FOOBAR1</h:MsgRef>"
+ " <h:CrDate>2022-05-05T06:07:14Z</h:CrDate>"
+ "</h:AppHdr>"
+ "<Doc:Document xmlns:Doc=\"urn:iso:std:iso:20022:tech:xsd:pacs.008.001.08\">"
+ " <Doc:FIToFICstmrCdtTrf>"
+ " <Doc:GrpHdr>"
+ " <Doc:MsgId>FOOBAR2</Doc:MsgId>"
+ " <Doc:CreDtTm>2022-05-05T06:07:14Z</Doc:CreDtTm>"
+ " <Doc:NbOfTxs>1</Doc:NbOfTxs>"
+ " <Doc:SttlmInf>"
+ " <Doc:SttlmMtd>INDA</Doc:SttlmMtd>"
+ " <Doc:SttlmAcct>"
+ " <Doc:Id>"
+ " <Doc:Othr>"
+ " <Doc:Id>04435001</Doc:Id>"
+ " </Doc:Othr>"
+ " </Doc:Id>"
+ " </Doc:SttlmAcct>"
+ " </Doc:SttlmInf>"
+ " <Doc:InstgAgt>"
+ " <Doc:FinInstnId>"
+ " <Doc:BICFI>AAAANGL0XXX</Doc:BICFI>"
+ " </Doc:FinInstnId>"
+ " </Doc:InstgAgt>"
+ " <Doc:InstdAgt>"
+ " <Doc:FinInstnId>"
+ " <Doc:BICFI>BBBBUS33XXX</Doc:BICFI>"
+ " </Doc:FinInstnId>"
+ " </Doc:InstdAgt>"
+ " </Doc:GrpHdr>"
+ " <Doc:CdtTrfTxInf>"
+ " <Doc:PmtId>"
+ " <Doc:InstrId>REF333222333</Doc:InstrId>"
+ " <Doc:EndToEndId>RRRR345345</Doc:EndToEndId>"
+ " <Doc:TxId>FFDD34534</Doc:TxId>"
+ " </Doc:PmtId>"
+ " <Doc:IntrBkSttlmAmt Ccy=\"USD\"></Doc:IntrBkSttlmAmt>"
+ " <Doc:IntrBkSttlmDt>2022-05-05</Doc:IntrBkSttlmDt>"
+ " <Doc:InstdAmt Ccy=\"USD\"></Doc:InstdAmt>"
+ " <Doc:ChrgBr>DEBT</Doc:ChrgBr>"
+ " <Doc:Dbtr>"
+ " <Doc:Nm>FOO FEED MILLS COLTD</Doc:Nm>"
+ " <Doc:PstlAdr>"
+ " <Doc:AdrLine>1 GOLDEN PENNY PLACE, WHARF ROAD,</Doc:AdrLine>"
+ " <Doc:AdrLine>APAPA LAGOS</Doc:AdrLine>"
+ " </Doc:PstlAdr>"
+ " </Doc:Dbtr>"
+ " <Doc:DbtrAcct>"
+ " <Doc:Id>"
+ " <Doc:Othr>"
+ " <Doc:Id>2028766092</Doc:Id>"
+ " </Doc:Othr>"
+ " </Doc:Id>"
+ " </Doc:DbtrAcct>"
+ " <Doc:DbtrAgt>"
+ " <Doc:FinInstnId>"
+ " <Doc:BICFI>AAAANGLA</Doc:BICFI>"
+ " </Doc:FinInstnId>"
+ " </Doc:DbtrAgt>"
+ " <Doc:CdtrAgt>"
+ " <Doc:FinInstnId>"
+ " <Doc:BICFI>BBBBRU21</Doc:BICFI>"
+ " </Doc:FinInstnId>"
+ " </Doc:CdtrAgt>"
+ " <Doc:Cdtr>"
+ " <Doc:Nm>TEST</Doc:Nm>"
+ " <Doc:PstlAdr>"
+ " <Doc:AdrLine>TEST</Doc:AdrLine>"
+ " </Doc:PstlAdr>"
+ " </Doc:Cdtr>"
+ " <Doc:CdtrAcct>"
+ " <Doc:Id>"
+ " <Doc:Othr>"
+ " <Doc:Id>TEST</Doc:Id>"
+ " </Doc:Othr>"
+ " </Doc:Id>"
+ " </Doc:CdtrAcct>"
+ " <Doc:RmtInf>"
+ " <Doc:Ustrd>AGRICULTURAL SECTOR</Doc:Ustrd>"
+ " </Doc:RmtInf>"
+ " </Doc:CdtTrfTxInf>"
+ " </Doc:FIToFICstmrCdtTrf>"
+ "</Doc:Document>"
+ "</RequestPayload>";
new MxSwiftMessage(xml);
} catch (Exception e) {
fail();
}
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Enhance test with assertions.

The test method currently checks for exceptions but lacks assertions to verify the expected behavior of MxSwiftMessage. Consider adding assertions to validate the parsing results.

// Example assertion to consider adding
// assertNotNull(parsedMessage);
// assertEquals(expectedValue, parsedMessage.getSomeProperty());

@@ -1,8 +1,29 @@
# Prowide ISO 20022 - CHANGELOG

#### 9.4.6 - May 2024
#### 9.5.4 - August 2024
Copy link
Contributor

Choose a reason for hiding this comment

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

Add a blank line after the heading.

Ensure that headings are surrounded by blank lines for better readability.

#### 9.5.4 - August 2024

* (PW-1958) Fixed the `DefaultMxMetadataStrategy` NPE issue when the amount values are null
Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
#### 9.5.4 - August 2024
#### 9.5.4 - August 2024
* (PW-1958) Fixed the `DefaultMxMetadataStrategy` NPE issue when the amount values are null
Tools
Markdownlint

3-3: Expected: h2; Actual: h4
Heading levels should only increment by one level at a time

(MD001, heading-increment)


3-3: Expected: 1; Actual: 0; Below
Headings should be surrounded by blank lines

(MD022, blanks-around-headings)

* (PW-1947) Updated MX model with latest SWIFT SRU2024 schema update, including new messages such as trck.001.001.03
* Add support for Business Application Header version head.001.001.04

#### 9.5.2 - June 2024
Copy link
Contributor

Choose a reason for hiding this comment

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

Add a blank line after the heading.

Ensure that headings are surrounded by blank lines for better readability.

#### 9.5.2 - June 2024

* (PW-1875) Fixed the `ZuluDateTimeAdapter` to convert the datetime to UTC offset if needed
Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
#### 9.5.2 - June 2024
#### 9.5.2 - June 2024
* (PW-1875) Fixed the `ZuluDateTimeAdapter` to convert the datetime to UTC offset if needed
Tools
Markdownlint

10-10: Expected: 1; Actual: 0; Below
Headings should be surrounded by blank lines

(MD022, blanks-around-headings)

* (PW-1875) Fixed the `ZuluDateTimeAdapter` to convert the datetime to UTC offset if needed


#### 9.5.1 - June 2024
Copy link
Contributor

Choose a reason for hiding this comment

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

Add a blank line after the heading.

Ensure that headings are surrounded by blank lines for better readability.

#### 9.5.1 - June 2024

* Enhanced the AppHdrFactory to honor the business service set in the parameter MxId
Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
#### 9.5.1 - June 2024
#### 9.5.1 - June 2024
* Enhanced the AppHdrFactory to honor the business service set in the parameter MxId
Tools
Markdownlint

13-13: Expected: 1; Actual: 0; Below
Headings should be surrounded by blank lines

(MD022, blanks-around-headings)

#### 9.5.4 - August 2024
* (PW-1958) Fixed the `DefaultMxMetadataStrategy` NPE issue when the amount values are null

#### 9.5.3 - August 2024
Copy link
Contributor

Choose a reason for hiding this comment

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

Add a blank line after the heading.

Ensure that headings are surrounded by blank lines for better readability.

#### 9.5.3 - August 2024

* (PW-1947) Updated MX model with latest SWIFT SRU2024 schema update, including new messages such as trck.001.001.03
Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
#### 9.5.3 - August 2024
#### 9.5.3 - August 2024
* (PW-1947) Updated MX model with latest SWIFT SRU2024 schema update, including new messages such as trck.001.001.03
Tools
Markdownlint

6-6: Expected: 1; Actual: 0; Below
Headings should be surrounded by blank lines

(MD022, blanks-around-headings)

Comment on lines +18 to +25
* SWIFT Standard release update 2024 (live 16 November 2024)
* Yearly revision of deprecation phase (see https://dev.prowidesoftware.com/SRU2024/getting-started/deprecation/)
* Added message categories for File Management (cafm), Fraud Reporting and Disposition (cafm), Network Management (canm), and Settlement Reporting (casr)
* Add support in the MxWriteConfiguration to use standard envelopes for SWIFT and ISO 20022
* Changed the default Document prefix to the message category; "camt", "pacs", etc...
* Enhanced MxId with optional and transient businessService field to act as a message type discriminator
* Dependency update: commons-lang3 -> 3.14.0
* Dependency update: gson -> 2.11.0
Copy link
Contributor

Choose a reason for hiding this comment

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

Fix the unordered list indentation.

Ensure the unordered list items are correctly indented.

* SWIFT Standard release update 2024 (live 16 November 2024)
* Yearly revision of deprecation phase ([see here](https://dev.prowidesoftware.com/SRU2024/getting-started/deprecation/))
* Added message categories for File Management (cafm), Fraud Reporting and Disposition (cafm), Network Management (canm), and Settlement Reporting (casr)
* Add support in the MxWriteConfiguration to use standard envelopes for SWIFT and ISO 20022
* Changed the default Document prefix to the message category; "camt", "pacs", etc...
* Enhanced MxId with optional and transient businessService field to act as a message type discriminator
* Dependency update: commons-lang3 -> 3.14.0
* Dependency update: gson -> 2.11.0
Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
* SWIFT Standard release update 2024 (live 16 November 2024)
* Yearly revision of deprecation phase (see https://dev.prowidesoftware.com/SRU2024/getting-started/deprecation/)
* Added message categories for File Management (cafm), Fraud Reporting and Disposition (cafm), Network Management (canm), and Settlement Reporting (casr)
* Add support in the MxWriteConfiguration to use standard envelopes for SWIFT and ISO 20022
* Changed the default Document prefix to the message category; "camt", "pacs", etc...
* Enhanced MxId with optional and transient businessService field to act as a message type discriminator
* Dependency update: commons-lang3 -> 3.14.0
* Dependency update: gson -> 2.11.0
* SWIFT Standard release update 2024 (live 16 November 2024)
* Yearly revision of deprecation phase ([see here](https://dev.prowidesoftware.com/SRU2024/getting-started/deprecation/))
* Added message categories for File Management (cafm), Fraud Reporting and Disposition (cafm), Network Management (canm), and Settlement Reporting (casr)
* Add support in the MxWriteConfiguration to use standard envelopes for SWIFT and ISO 20022
* Changed the default Document prefix to the message category; "camt", "pacs", etc...
* Enhanced MxId with optional and transient businessService field to act as a message type discriminator
* Dependency update: commons-lang3 -> 3.14.0
* Dependency update: gson -> 2.11.0
Tools
Markdownlint

18-18: Expected: 0; Actual: 2
Unordered list indentation

(MD007, ul-indent)


19-19: Expected: 0; Actual: 2
Unordered list indentation

(MD007, ul-indent)


20-20: Expected: 0; Actual: 2
Unordered list indentation

(MD007, ul-indent)


21-21: Expected: 0; Actual: 2
Unordered list indentation

(MD007, ul-indent)


22-22: Expected: 0; Actual: 2
Unordered list indentation

(MD007, ul-indent)


23-23: Expected: 0; Actual: 2
Unordered list indentation

(MD007, ul-indent)


24-24: Expected: 0; Actual: 2
Unordered list indentation

(MD007, ul-indent)


25-25: Expected: 0; Actual: 2
Unordered list indentation

(MD007, ul-indent)


18-18: null
Lists should be surrounded by blank lines

(MD032, blanks-around-lists)


19-19: null
Bare URL used

(MD034, no-bare-urls)

Comment on lines +17 to +19
#### 9.5.0 - May 2024
* SWIFT Standard release update 2024 (live 16 November 2024)
* Yearly revision of deprecation phase (see https://dev.prowidesoftware.com/SRU2024/getting-started/deprecation/)
Copy link
Contributor

Choose a reason for hiding this comment

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

Fix the heading and URL formatting.

Add a blank line after the heading and replace the bare URL with a markdown link.

#### 9.5.0 - May 2024

* SWIFT Standard release update 2024 (live 16 November 2024)
* Yearly revision of deprecation phase ([see here](https://dev.prowidesoftware.com/SRU2024/getting-started/deprecation/))
Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
#### 9.5.0 - May 2024
* SWIFT Standard release update 2024 (live 16 November 2024)
* Yearly revision of deprecation phase (see https://dev.prowidesoftware.com/SRU2024/getting-started/deprecation/)
#### 9.5.0 - May 2024
* SWIFT Standard release update 2024 (live 16 November 2024)
* Yearly revision of deprecation phase ([see here](https://dev.prowidesoftware.com/SRU2024/getting-started/deprecation/))
Tools
Markdownlint

18-18: Expected: 0; Actual: 2
Unordered list indentation

(MD007, ul-indent)


19-19: Expected: 0; Actual: 2
Unordered list indentation

(MD007, ul-indent)


17-17: Expected: 1; Actual: 0; Below
Headings should be surrounded by blank lines

(MD022, blanks-around-headings)


18-18: null
Lists should be surrounded by blank lines

(MD032, blanks-around-lists)


19-19: null
Bare URL used

(MD034, no-bare-urls)

@zubri zubri merged commit 89fb355 into main Nov 19, 2024
1 check passed
@zubri zubri deleted the SRU2024 branch November 19, 2024 12:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant