Skip to content

Commit

Permalink
CU-3vkh3u7 GH-63 ISO20022 model upgrade (#67)
Browse files Browse the repository at this point in the history
* add generated model classes
* added factory and parser API for header V3
* Removed obsolete trea (treasury) message types
* javadoc task fixes
  • Loading branch information
zubri authored Nov 20, 2022
1 parent df58126 commit b796ed3
Show file tree
Hide file tree
Showing 5,173 changed files with 664,868 additions and 42,538 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Prowide ISO 20022 - CHANGELOG

#### 9.3.4 SNAPSHOT
* (GH-63) Added message type versions in categories: acmt, admi, auth, caaa, camt, catm, fxtr, pacs, reda, seev, semt, sese, setr, supl and trck
* Added new business process and messages for: caad, cafc, cain, casp
* Removed obsolete trea (treasury) message types
* Added model and support for the BusinessApplicationHeaderV03

#### 9.3.3 - October 2022
* (PW-1082) Added support in the JaxbContextCache and its default implementation to create the context without the classes parameter

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ This project is a complement for the **Prowide Core** library: https://github.co
For SWIFT messages validation, restricted ISO versions (such as SEPA, CBPR+, TARGET), GUI application and more, please check our complementary commercial offerings at https://www.prowidesoftware.com/

### Documentation
* Documentation site https://www.prowidesoftware.com/resources
* Documentation site https://dev.prowidesoftware.com/
* Javadoc https://www.javadoc.io/doc/com.prowidesoftware/pw-iso20022/
* Code examples https://github.com/prowide/prowide-iso20022-examples

Expand Down
42 changes: 30 additions & 12 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ group 'com.prowidesoftware'

project.ext {
SRU = 'SRU2022'
// this is not working since the version is unresolved at this point, to publish snapshots just uncomment below until this is fixed
//nexusRepo = 'maven-snapshots'
nexusRepo = project.version.endsWith('-SNAPSHOT') ? 'maven-snapshots' : 'maven-releases'
}

Expand Down Expand Up @@ -127,7 +129,7 @@ configure(subprojects.findAll {it.name.endsWith('-mx')}) {
project(':iso20022-core') {
dependencies {
// included build
api 'com.prowidesoftware:pw-swift-core:SRU2022-9.3.5'
api 'com.prowidesoftware:pw-swift-core:SRU2022-9.3.8'


implementation 'org.apache.commons:commons-lang3:3.12.0'
Expand Down Expand Up @@ -196,13 +198,20 @@ def formattedDate() {
new Date().format('dd MMM yyyy')
}

//task aggregatedJavadoc(type: Javadoc) {
// define an array of project names
def projectsIncludedInJavadoc = [
'iso20022-core',
'model-pacs-mx',
'model-xsys-mx'
]

javadoc {
group = 'Documentation'
description = 'Generate javadocs from all child projects as if it was a single project'

verbose false
failOnError false
//maxMemory = 2G
destinationDir = file("$buildDir/docs/javadoc")

options.overview = "overview.html"
Expand All @@ -212,27 +221,32 @@ javadoc {
options.footer="${SRU}, generated ${formattedDate()}"
options.author false
options.links 'http://docs.oracle.com/javase/8/docs/api/'
options.addStringOption 'Xdoclint:none', '-quiet'

// this will fail when the option is not available (older JDK)
options.addBooleanOption("-allow-script-in-comments", true)

options.bottom = '<script src="//static.getclicky.com/js"></script><script>try{ clicky.init(101039278); }catch(e){}</script>'

// exclude the dictionary package because it is huge; and being simple POJO classes does not add to much value to the Javadoc
exclude "**/dic/**"
// exclude first version of each Mx type, just to reduce Javadoc files volume
exclude "**/model/mx/Mx**01"
//exclude "**/model/mx/MxTrck**"
exclude "**/model/mx/MxSupl**"
//exclude "**/model/mx/MxTsmt**"
// exclude "**/dic/**"

// exclude miscellaneous/generic categories
// exclude "**/model/mx/MxAcmt**"
// exclude "**/model/mx/MxAdmi**"
// exclude "**/model/mx/MxAuth**"
// exclude "**/model/mx/MxCbrf**"
// exclude "**/model/mx/MxColr**"
// exclude "**/model/mx/MxFxtr**"
// exclude "**/model/mx/MxReda**"
// exclude "**/model/mx/MxTrck**"

options.addStringOption('Xdoclint:none', '-quiet')
options.addStringOption('encoding', 'UTF-8')
options.addStringOption('charSet', 'UTF-8')

subprojects.each { proj ->
proj.tasks.withType(Javadoc).each { javadocTask ->
// iterate projectsIncludedInJavadoc array and include projects source folders in the javadoc
projectsIncludedInJavadoc.each { projectName ->
project(projectName).tasks.withType(Javadoc).each { javadocTask ->
source += javadocTask.source
classpath += javadocTask.classpath
excludes += javadocTask.excludes
Expand All @@ -254,7 +268,7 @@ artifacts {
// declared dependencies for pom generation
dependencies {
// included build (keep in sync with the latest Prowide Core version)
api 'com.prowidesoftware:pw-swift-core:SRU2022-9.3.5'
api 'com.prowidesoftware:pw-swift-core:SRU2022-9.3.8'
implementation 'org.apache.commons:commons-lang3:3.12.0'
implementation 'com.google.code.gson:gson:2.9.0'
}
Expand Down Expand Up @@ -324,6 +338,10 @@ publishing {
}
jar.finalizedBy generatePomFileForMavenJavaPublication

publish {
println "Using ${nexusRepo} for publishing ${version}"
}

tasks.withType(GenerateModuleMetadata) {
// to avoid metadata in the generated pom.xml files
enabled = false
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,19 +15,27 @@
*/
package com.prowidesoftware.swift.model;

import com.prowidesoftware.deprecation.ProwideDeprecated;
import com.prowidesoftware.deprecation.TargetYear;

import java.util.Collection;

/**
* SWIFT business process classification for MX messages.
*
* @author www.prowidesoftware.com
* @since 7.0
*/
public enum MxBusinessProcess {
acmt("Account Management"),
admi("Administration"),
auth("Authorities"),
caaa("Acceptor to Acquirer Card Transactions"),
caad("Card Administration"),
caam("ATM Management"),
cafc("Fee Collection"),
cain("Acquirer to Issuer Card Transactions"),
camt("Cash Management"),
casp("Sale to POI Card Transactions"),
catm("Terminal Management"),
catp("ATM Card Transactions"),
cbrf(""),
Expand All @@ -47,7 +55,14 @@ public enum MxBusinessProcess {
setr("Securities Trade"),
supl("Supplementary Data"),
trck("Payments Tracker"),

/**
* @deprecated Obsolete to be withdrawn (non-ISO)
*/
@ProwideDeprecated(phase2 = TargetYear.SRU2023)
@Deprecated
trea("Treasury"),

tsin("Trade Services Initiation"),
tsmt("Trade Services Management"),
tsrv("Trade Services"),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,49 @@ public static BusinessAppHdrV02 createBusinessAppHdrV02(final String sender, fin
return h;
}

/**
* Convenient method to create a new ISO header version 3, initialized from simple parameters.
*
* <p>All parameters are optional but in order for the header to be valid the sender, receiver and reference must
* be set. Creation date will be set to current time.
*
* @param sender optional sender BIC for the Fr element or null to leave not set
* @param receiver optional receiver BIC for the To element or null to leave not set
* @param reference optional reference for the BizMsgIdr (business message identifier) or null to leave not set
* @param id optional MX identification for the MsgDefIdr (message definition identifier) element or null to leave not set
* @return new header initialized from parameters.
* @since 9.3.4
*/
public static BusinessAppHdrV03 createBusinessAppHdrV03(final String sender, final String receiver, final String reference, final MxId id) {
BusinessAppHdrV03 h = new BusinessAppHdrV03();

if (sender != null) {
h.setFr(new Party44Choice());
h.getFr().setFIId(new BranchAndFinancialInstitutionIdentification6());
h.getFr().getFIId().setFinInstnId(new FinancialInstitutionIdentification18());
h.getFr().getFIId().getFinInstnId().setBICFI(sender);
}

if (receiver != null) {
h.setTo(new Party44Choice());
h.getTo().setFIId(new BranchAndFinancialInstitutionIdentification6());
h.getTo().getFIId().setFinInstnId(new FinancialInstitutionIdentification18());
h.getTo().getFIId().getFinInstnId().setBICFI(receiver);
}

if (reference != null) {
h.setBizMsgIdr(reference);
}

if (id != null) {
h.setMsgDefIdr(id.id());
}

h.setCreDt(XMLGregorianCalendarUtils.now());

return h;
}

/**
* Convenient method to create a new legacy SWIFT header, initialized from simple parameters.
*
Expand Down Expand Up @@ -181,6 +224,8 @@ public static AppHdr createAppHdr(AppHdrType type, final String sender, final St
return createBusinessAppHdrV01(sender, receiver, reference, id);
case BAH_V2:
return createBusinessAppHdrV02(sender, receiver, reference, id);
case BAH_V3:
return createBusinessAppHdrV03(sender, receiver, reference, id);
default:
throw new ProwideException("Don't know how to create header " + type);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,10 @@ private static AppHdr parseHeaderFromSAXSource(final String xml, final String na
// parse BAH version 2
return (BusinessAppHdrV02) MxParseUtils.parseSAXSource(source, BusinessAppHdrV02.class, BusinessAppHdrV02._classes, params);

} else if (StringUtils.equals(BusinessAppHdrV03.NAMESPACE, namespace)) {
// parse BAH version 3
return (BusinessAppHdrV03) MxParseUtils.parseSAXSource(source, BusinessAppHdrV03.class, BusinessAppHdrV03._classes, params);

} else {
// by default try to parse to BAH version 1
return (BusinessAppHdrV01) MxParseUtils.parseSAXSource(source, BusinessAppHdrV01.class, BusinessAppHdrV01._classes, params);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@
public enum AppHdrType {
LEGACY(LegacyAppHdr.NAMESPACE, LegacyAppHdr.class),
BAH_V1(BusinessAppHdrV01.NAMESPACE, BusinessAppHdrV01.class),
BAH_V2(BusinessAppHdrV02.NAMESPACE, BusinessAppHdrV02.class);
BAH_V2(BusinessAppHdrV02.NAMESPACE, BusinessAppHdrV02.class),
BAH_V3(BusinessAppHdrV03.NAMESPACE, BusinessAppHdrV03.class);

private String namespace;
private Class headerClass;
Expand Down
Loading

0 comments on commit b796ed3

Please sign in to comment.