-
Notifications
You must be signed in to change notification settings - Fork 68
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
Add support for business application header version head.001.001.04 v10 #124
Add support for business application header version head.001.001.04 v10 #124
Conversation
Caution Review failedThe pull request is closed. WalkthroughWalkthroughThe recent updates to the Prowide ISO 20022 library in version 10.2.2 significantly enhance compatibility with the latest SWIFT messaging standards and improve overall functionality. Key improvements include the introduction of support for Business Application Header version 4, updates to the MX model, and various fixes to date and time handling. These changes facilitate smoother transitions for existing implementations while expanding the library’s capabilities. Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant AppHdrFactory
participant BusinessAppHdrV04
participant AppHdrParser
User->>AppHdrFactory: createBusinessAppHdrV04(sender, receiver, reference, id)
AppHdrFactory->>BusinessAppHdrV04: Initialize with parameters
BusinessAppHdrV04-->>AppHdrFactory: Return new header instance
AppHdrFactory-->>User: Return header instance
User->>AppHdrParser: parseHeaderFromSAXSource(source, namespace)
AppHdrParser-->>User: Return parsed header instance
This diagram outlines the interactions involved in creating a new Business Application Header and parsing it, illustrating the flow from user input to header creation and parsing functionality. 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? TipsChatThere are 3 ways to chat with CodeRabbit:
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 as PR comments)
Additionally, you can add CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 11
@@ -1,8 +1,10 @@ | |||
# Prowide ISO 20022 - CHANGELOG | |||
|
|||
#### 10.2.2 - SNAPSHOT | |||
#### 10.2.2 - August 2024 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fix heading level.
The heading level should be h2
instead of h4
.
-#### 10.2.2 - August 2024
+## 10.2.2 - August 2024
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.
#### 10.2.2 - August 2024 | |
## 10.2.2 - August 2024 |
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)
CHANGELOG.md
Outdated
* (PW-1947) Updated MX model with latest SWIFT SRU2024 schema update, including new messages such as trck.001.001.03 | ||
* (PW-1933) Fix backward compatibility issue on DateTime fields when doing JSON to model conversion | ||
* (PW-1875) Fixed the `ZuluDateTimeAdapter` to convert the datetime to UTC offset if needed | ||
* Add support for Business Application Header version head.001.001.04 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fix unordered list indentation and add blank lines.
The unordered list items should be indented properly and surrounded by blank lines.
- * (PW-1947) Updated MX model with latest SWIFT SRU2024 schema update, including new messages such as trck.001.001.03
- * (PW-1933) Fix backward compatibility issue on DateTime fields when doing JSON to model conversion
- * (PW-1875) Fixed the `ZuluDateTimeAdapter` to convert the datetime to UTC offset if needed
- * Add support for Business Application Header version head.001.001.04
+* (PW-1947) Updated MX model with latest SWIFT SRU2024 schema update, including new messages such as trck.001.001.03
+
+* (PW-1933) Fix backward compatibility issue on DateTime fields when doing JSON to model conversion
+
+* (PW-1875) Fixed the `ZuluDateTimeAdapter` to convert the datetime to UTC offset if needed
+
+* Add support for Business Application Header version head.001.001.04
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.
* (PW-1947) Updated MX model with latest SWIFT SRU2024 schema update, including new messages such as trck.001.001.03 | |
* (PW-1933) Fix backward compatibility issue on DateTime fields when doing JSON to model conversion | |
* (PW-1875) Fixed the `ZuluDateTimeAdapter` to convert the datetime to UTC offset if needed | |
* Add support for Business Application Header version head.001.001.04 | |
* (PW-1947) Updated MX model with latest SWIFT SRU2024 schema update, including new messages such as trck.001.001.03 | |
* (PW-1933) Fix backward compatibility issue on DateTime fields when doing JSON to model conversion | |
* (PW-1875) Fixed the `ZuluDateTimeAdapter` to convert the datetime to UTC offset if needed | |
* Add support for Business Application Header version head.001.001.04 |
Tools
LanguageTool
[grammar] ~7-~7: Did you mean “to Add”?
Context: ...he datetime to UTC offset if needed * Add support for Business Application Header...(MISSING_TO_BEFORE_A_VERB)
Markdownlint
4-4: Expected: 0; Actual: 2
Unordered list indentation(MD007, ul-indent)
5-5: Expected: 0; Actual: 2
Unordered list indentation(MD007, ul-indent)
6-6: Expected: 0; Actual: 2
Unordered list indentation(MD007, ul-indent)
7-7: Expected: 0; Actual: 2
Unordered list indentation(MD007, ul-indent)
4-4: null
Lists should be surrounded by blank lines(MD032, blanks-around-lists)
@@ -0,0 +1,415 @@ | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add file-level documentation.
Consider adding a file-level comment to describe the purpose of this class and its usage.
@XmlElement(name = "CharSet") | ||
protected String charSet; | ||
@XmlElement(name = "Fr", required = true) | ||
protected Party51Choice fr; | ||
@XmlElement(name = "To", required = true) | ||
protected Party51Choice to; | ||
@XmlElement(name = "BizMsgIdr", required = true) | ||
protected String bizMsgIdr; | ||
@XmlElement(name = "MsgDefIdr", required = true) | ||
protected String msgDefIdr; | ||
@XmlElement(name = "BizSvc") | ||
protected String bizSvc; | ||
@XmlElement(name = "MktPrctc") | ||
protected ImplementationSpecification1 mktPrctc; | ||
@XmlElement(name = "CreDt", required = true, type = String.class) | ||
@XmlJavaTypeAdapter(IsoDateTimeAdapter.class) | ||
@XmlSchemaType(name = "dateTime") | ||
protected OffsetDateTime creDt; | ||
@XmlElement(name = "BizPrcgDt", type = String.class) | ||
@XmlJavaTypeAdapter(IsoDateTimeAdapter.class) | ||
@XmlSchemaType(name = "dateTime") | ||
protected OffsetDateTime bizPrcgDt; | ||
@XmlElement(name = "CpyDplct") | ||
@XmlSchemaType(name = "string") | ||
protected CopyDuplicate1Code cpyDplct; | ||
@XmlElement(name = "PssblDplct") | ||
protected Boolean pssblDplct; | ||
@XmlElement(name = "Prty") | ||
protected String prty; | ||
@XmlElement(name = "Sgntr") | ||
protected SignatureEnvelope sgntr; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ensure all fields have appropriate documentation.
Ensure that all fields have appropriate documentation to describe their purpose and usage.
@XmlElement(name = "CharSet")
protected String charSet;
@XmlElement(name = "Fr", required = true)
protected Party51Choice fr;
@XmlElement(name = "To", required = true)
protected Party51Choice to;
@XmlElement(name = "BizMsgIdr", required = true)
protected String bizMsgIdr;
@XmlElement(name = "MsgDefIdr", required = true)
protected String msgDefIdr;
@XmlElement(name = "BizSvc")
protected String bizSvc;
@XmlElement(name = "MktPrctc")
protected ImplementationSpecification1 mktPrctc;
@XmlElement(name = "CreDt", required = true, type = String.class)
@XmlJavaTypeAdapter(IsoDateTimeAdapter.class)
@XmlSchemaType(name = "dateTime")
protected OffsetDateTime creDt;
@XmlElement(name = "BizPrcgDt", type = String.class)
@XmlJavaTypeAdapter(IsoDateTimeAdapter.class)
@XmlSchemaType(name = "dateTime")
protected OffsetDateTime bizPrcgDt;
@XmlElement(name = "CpyDplct")
@XmlSchemaType(name = "string")
protected CopyDuplicate1Code cpyDplct;
@XmlElement(name = "PssblDplct")
protected Boolean pssblDplct;
@XmlElement(name = "Prty")
protected String prty;
@XmlElement(name = "Sgntr")
protected SignatureEnvelope sgntr;
Committable suggestion was skipped due to low confidence.
@@ -0,0 +1,467 @@ | |||
|
|||
package com.prowidesoftware.swift.model.mx.dic; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add a class-level Javadoc comment.
Consider adding a class-level Javadoc comment to describe the purpose and usage of BusinessApplicationHeaderV04Impl
.
* {@link String } | ||
* | ||
*/ | ||
public String getPrty() { | ||
return prty; | ||
} | ||
|
||
/** | ||
* Sets the value of the prty property. | ||
* | ||
* @param value | ||
* allowed object is | ||
* {@link String } | ||
* | ||
*/ | ||
public BusinessApplicationHeaderV04Impl setPrty(String value) { | ||
this.prty = value; | ||
return this; | ||
} | ||
|
||
/** | ||
* Gets the value of the sgntr property. | ||
* | ||
* @return | ||
* possible object is | ||
* {@link SignatureEnvelope } | ||
* | ||
*/ | ||
public SignatureEnvelope getSgntr() { | ||
return sgntr; | ||
} | ||
|
||
/** | ||
* Sets the value of the sgntr property. | ||
* | ||
* @param value | ||
* allowed object is | ||
* {@link SignatureEnvelope } | ||
* | ||
*/ | ||
public BusinessApplicationHeaderV04Impl setSgntr(SignatureEnvelope value) { | ||
this.sgntr = value; | ||
return this; | ||
} | ||
|
||
/** | ||
* Gets the value of the rltd property. | ||
* | ||
* <p> | ||
* This accessor method returns a reference to the live list, | ||
* not a snapshot. Therefore any modification you make to the | ||
* returned list will be present inside the Jakarta XML Binding object. | ||
* This is why there is not a {@code set} method for the rltd property. | ||
* | ||
* <p> | ||
* For example, to add a new item, do as follows: | ||
* <pre> | ||
* getRltd().add(newItem); | ||
* </pre> | ||
* | ||
* | ||
* <p> | ||
* Objects of the following type(s) are allowed in the list | ||
* {@link BusinessApplicationHeader8 } | ||
* | ||
* | ||
* @return | ||
* The value of the rltd property. | ||
*/ | ||
public List<BusinessApplicationHeader8> getRltd() { | ||
if (rltd == null) { | ||
rltd = new ArrayList<>(); | ||
} | ||
return this.rltd; | ||
} | ||
|
||
@Override | ||
public String toString() { | ||
return ToStringBuilder.reflectionToString(this, ToStringStyle.MULTI_LINE_STYLE); | ||
} | ||
|
||
@Override | ||
public boolean equals(Object that) { | ||
return EqualsBuilder.reflectionEquals(this, that); | ||
} | ||
|
||
@Override | ||
public int hashCode() { | ||
return HashCodeBuilder.reflectionHashCode(this); | ||
} | ||
|
||
/** | ||
* Adds a new item to the rltd list. | ||
* @see #getRltd() | ||
* | ||
*/ | ||
public BusinessApplicationHeaderV04Impl addRltd(BusinessApplicationHeader8 rltd) { | ||
getRltd().add(rltd); | ||
return this; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add Javadoc comments for methods.
Consider adding Javadoc comments for each method to describe their purpose and usage.
import java.time.OffsetDateTime; | ||
import java.util.ArrayList; | ||
import java.util.List; | ||
import com.prowidesoftware.swift.model.mx.adapters.IsoDateTimeAdapter; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Optimize imports by removing unused ones.
The import java.util.ArrayList
is not used in the class. Remove it to keep the imports clean.
- import java.util.ArrayList;
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.
import java.time.OffsetDateTime; | |
import java.util.ArrayList; | |
import java.util.List; | |
import com.prowidesoftware.swift.model.mx.adapters.IsoDateTimeAdapter; | |
import java.time.OffsetDateTime; | |
import java.util.List; | |
import com.prowidesoftware.swift.model.mx.adapters.IsoDateTimeAdapter; |
@XmlElement(name = "CharSet") | ||
protected String charSet; | ||
@XmlElement(name = "Fr", required = true) | ||
protected Party51Choice fr; | ||
@XmlElement(name = "To", required = true) | ||
protected Party51Choice to; | ||
@XmlElement(name = "BizMsgIdr", required = true) | ||
protected String bizMsgIdr; | ||
@XmlElement(name = "MsgDefIdr", required = true) | ||
protected String msgDefIdr; | ||
@XmlElement(name = "BizSvc") | ||
protected String bizSvc; | ||
@XmlElement(name = "MktPrctc") | ||
protected ImplementationSpecification1 mktPrctc; | ||
@XmlElement(name = "CreDt", required = true, type = String.class) | ||
@XmlJavaTypeAdapter(IsoDateTimeAdapter.class) | ||
@XmlSchemaType(name = "dateTime") | ||
protected OffsetDateTime creDt; | ||
@XmlElement(name = "BizPrcgDt", type = String.class) | ||
@XmlJavaTypeAdapter(IsoDateTimeAdapter.class) | ||
@XmlSchemaType(name = "dateTime") | ||
protected OffsetDateTime bizPrcgDt; | ||
@XmlElement(name = "CpyDplct") | ||
@XmlSchemaType(name = "string") | ||
protected CopyDuplicate1Code cpyDplct; | ||
@XmlElement(name = "PssblDplct") | ||
protected Boolean pssblDplct; | ||
@XmlElement(name = "Prty") | ||
protected String prty; | ||
@XmlElement(name = "Sgntr") | ||
protected SignatureEnvelope sgntr; | ||
@XmlElement(name = "Rltd") | ||
protected List<BusinessApplicationHeader8> rltd; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add null checks in setters.
Consider adding null checks in the setter methods for required properties to ensure data integrity.
- public BusinessApplicationHeaderV04Impl setFr(Party51Choice value) {
- this.fr = value;
- return this;
- }
+ public BusinessApplicationHeaderV04Impl setFr(Party51Choice value) {
+ if (value == null) {
+ throw new IllegalArgumentException("Fr cannot be null");
+ }
+ this.fr = value;
+ return this;
+ }
Committable suggestion was skipped due to low confidence.
protected SignatureEnvelope sgntr; | ||
@XmlElement(name = "Rltd") | ||
protected List<BusinessApplicationHeader8> rltd; | ||
public static final transient Class[] _classes = new Class[] {AddressType2Code.class, AddressType3Choice.class, BranchAndFinancialInstitutionIdentification8 .class, BranchData5 .class, BusinessApplicationHeader8 .class, BusinessApplicationHeaderV04Impl.class, ClearingSystemIdentification2Choice.class, ClearingSystemMemberIdentification2 .class, Contact13 .class, CopyDuplicate1Code.class, DateAndPlaceOfBirth1 .class, FinancialIdentificationSchemeName1Choice.class, FinancialInstitutionIdentification23 .class, GenericFinancialIdentification1 .class, GenericIdentification30 .class, GenericOrganisationIdentification3 .class, GenericPersonIdentification2 .class, ImplementationSpecification1 .class, NamePrefix2Code.class, OrganisationIdentification39 .class, OrganisationIdentificationSchemeName1Choice.class, OtherContact1 .class, Party51Choice.class, Party52Choice.class, PartyIdentification272 .class, PersonIdentification18 .class, PersonIdentificationSchemeName1Choice.class, PostalAddress27 .class, PreferredContactMethod2Code.class, SignatureEnvelope.class }; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove unnecessary transient
modifier.
The transient
modifier is not necessary for the _classes
field since it is already static
.
- public static final transient Class[] _classes = new Class[] {AddressType2Code.class, AddressType3Choice.class, BranchAndFinancialInstitutionIdentification8 .class, BranchData5 .class, BusinessApplicationHeader8 .class, BusinessApplicationHeaderV04Impl.class, ClearingSystemIdentification2Choice.class, ClearingSystemMemberIdentification2 .class, Contact13 .class, CopyDuplicate1Code.class, DateAndPlaceOfBirth1 .class, FinancialIdentificationSchemeName1Choice.class, FinancialInstitutionIdentification23 .class, GenericFinancialIdentification1 .class, GenericIdentification30 .class, GenericOrganisationIdentification3 .class, GenericPersonIdentification2 .class, ImplementationSpecification1 .class, NamePrefix2Code.class, OrganisationIdentification39 .class, OrganisationIdentificationSchemeName1Choice.class, OtherContact1 .class, Party51Choice.class, Party52Choice.class, PartyIdentification272 .class, PersonIdentification18 .class, PersonIdentificationSchemeName1Choice.class, PostalAddress27 .class, PreferredContactMethod2Code.class, SignatureEnvelope.class };
+ public static final Class[] _classes = new Class[] {AddressType2Code.class, AddressType3Choice.class, BranchAndFinancialInstitutionIdentification8 .class, BranchData5 .class, BusinessApplicationHeader8 .class, BusinessApplicationHeaderV04Impl.class, ClearingSystemIdentification2Choice.class, ClearingSystemMemberIdentification2 .class, Contact13 .class, CopyDuplicate1Code.class, DateAndPlaceOfBirth1 .class, FinancialIdentificationSchemeName1Choice.class, FinancialInstitutionIdentification23 .class, GenericFinancialIdentification1 .class, GenericIdentification30 .class, GenericOrganisationIdentification3 .class, GenericPersonIdentification2 .class, ImplementationSpecification1 .class, NamePrefix2Code.class, OrganisationIdentification39 .class, OrganisationIdentificationSchemeName1Choice.class, OtherContact1 .class, Party51Choice.class, Party52Choice.class, PartyIdentification272 .class, PersonIdentification18 .class, PersonIdentificationSchemeName1Choice.class, PostalAddress27 .class, PreferredContactMethod2Code.class, SignatureEnvelope.class };
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.
public static final transient Class[] _classes = new Class[] {AddressType2Code.class, AddressType3Choice.class, BranchAndFinancialInstitutionIdentification8 .class, BranchData5 .class, BusinessApplicationHeader8 .class, BusinessApplicationHeaderV04Impl.class, ClearingSystemIdentification2Choice.class, ClearingSystemMemberIdentification2 .class, Contact13 .class, CopyDuplicate1Code.class, DateAndPlaceOfBirth1 .class, FinancialIdentificationSchemeName1Choice.class, FinancialInstitutionIdentification23 .class, GenericFinancialIdentification1 .class, GenericIdentification30 .class, GenericOrganisationIdentification3 .class, GenericPersonIdentification2 .class, ImplementationSpecification1 .class, NamePrefix2Code.class, OrganisationIdentification39 .class, OrganisationIdentificationSchemeName1Choice.class, OtherContact1 .class, Party51Choice.class, Party52Choice.class, PartyIdentification272 .class, PersonIdentification18 .class, PersonIdentificationSchemeName1Choice.class, PostalAddress27 .class, PreferredContactMethod2Code.class, SignatureEnvelope.class }; | |
public static final Class[] _classes = new Class[] {AddressType2Code.class, AddressType3Choice.class, BranchAndFinancialInstitutionIdentification8 .class, BranchData5 .class, BusinessApplicationHeader8 .class, BusinessApplicationHeaderV04Impl.class, ClearingSystemIdentification2Choice.class, ClearingSystemMemberIdentification2 .class, Contact13 .class, CopyDuplicate1Code.class, DateAndPlaceOfBirth1 .class, FinancialIdentificationSchemeName1Choice.class, FinancialInstitutionIdentification23 .class, GenericFinancialIdentification1 .class, GenericIdentification30 .class, GenericOrganisationIdentification3 .class, GenericPersonIdentification2 .class, ImplementationSpecification1 .class, NamePrefix2Code.class, OrganisationIdentification39 .class, OrganisationIdentificationSchemeName1Choice.class, OtherContact1 .class, Party51Choice.class, Party52Choice.class, PartyIdentification272 .class, PersonIdentification18 .class, PersonIdentificationSchemeName1Choice.class, PostalAddress27 .class, PreferredContactMethod2Code.class, SignatureEnvelope.class }; |
if (envelopeType.prefix() != null) { | ||
xml.append(envelopeType.prefix()).append(":"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fix indentation.
Ensure consistent indentation for the closing tag.
- xml.append("</");
- if (envelopeType.prefix() != null) {
- xml.append(envelopeType.prefix()).append(":");
- }
- xml.append(envelopeElement).append(">");
+ xml.append("</");
+ if (envelopeType.prefix() != null) {
+ xml.append(envelopeType.prefix()).append(":");
+ }
+ xml.append(envelopeElement).append(">");
Committable suggestion was skipped due to low confidence.
…Header-version-head.001.001.04-v10
Summary by CodeRabbit
New Features
head.001.001.04
.Bug Fixes
Documentation
Tests