Skip to content

Commit

Permalink
- Split Street and StreetNumber into two properties
Browse files Browse the repository at this point in the history
- Don't export postal adress properties if empty
- Don't export InstructionForDebtorAgent if empty
  • Loading branch information
ThomasEnioKohler committed Apr 13, 2023
1 parent b4aa21a commit 48c3e94
Show file tree
Hide file tree
Showing 5 changed files with 36 additions and 15 deletions.
6 changes: 3 additions & 3 deletions iso20022-generator/generator-test/GeneratorTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ public void InitGenerator()
{
UniqueDocumentId = Guid.NewGuid().ToString().Substring(0, 34), // Must be unique for the bank within 90 days
ContactDetailsName = "enio AG",
ContactDetailsOther = "3.0.1",
ContactDetailsOther = "3.0.2",
AutoCalculateControlSum = true
// SenderBic = "ZKBKCHZZ80A" //ZKB
},
Expand Down Expand Up @@ -93,7 +93,7 @@ public void InitGenerator()
{
UniqueDocumentId = Guid.NewGuid().ToString().Substring(0, 34), // Must be unique for the bank within 90 days
ContactDetailsName = "enio AG",
ContactDetailsOther = "3.0.1",
ContactDetailsOther = "3.0.2",
AutoCalculateControlSum = true
// SenderBic = "ZKBKCHZZ80A" //ZKB
},
Expand Down Expand Up @@ -132,7 +132,7 @@ public void InitGenerator()
{
UniqueDocumentId = Guid.NewGuid().ToString().Substring(0, 34), // Must be unique for the bank within 90 days
ContactDetailsName = "enio AG",
ContactDetailsOther = "3.0.1",
ContactDetailsOther = "3.0.2",
AutoCalculateControlSum = true
},
new Sender()
Expand Down
32 changes: 24 additions & 8 deletions iso20022-generator/iso20022-generator/Pain001Generator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -132,20 +132,33 @@ public void AddTransaction(PaymentInstructionInformation3CH pmtInf, Receiver rec
cdtr.Nm = receiver.Name; // Index 2.79 / Name
if (!string.IsNullOrWhiteSpace(receiver.City))
{
PostalAddress6CH pstlAdr = new PostalAddress6CH(); // Index 2.79 / Postal Address
PostalAddress6CH pstlAdr = new PostalAddress6CH(); // Index 2.77 / Postal Address
cdtr.PstlAdr = pstlAdr;

if (!string.IsNullOrWhiteSpace(receiver.StreetName))
{
pstlAdr.StrtNm = receiver.StreetName; // Index 2.77 / Street Name
}

if (!string.IsNullOrWhiteSpace(receiver.StreetNumber))
{
pstlAdr.BldgNb = receiver.StreetNumber; // Index 2.77 / Building Number
}

pstlAdr.StrtNm = receiver.StreetName; // Index 2.79 / Street Name
if (!string.IsNullOrWhiteSpace(receiver.Zip))
{
pstlAdr.PstCd = receiver.Zip; // Index 2.77 / Post Code
}

if (!string.IsNullOrWhiteSpace(receiver.StreetNumber))
if (!string.IsNullOrWhiteSpace(receiver.City))
{
pstlAdr.StrtNm = receiver.StreetName + " " + receiver.StreetNumber; // Index 2.79 / Building Number
pstlAdr.TwnNm = receiver.City; // Index 2.77 / Town Name
}

pstlAdr.PstCd = receiver.Zip; // Index 2.79 / Post Code
pstlAdr.TwnNm = receiver.City; // Index 2.79 / Town Name
pstlAdr.Ctry = receiver.CountryCode; // Index 2.79 / Country
if (!string.IsNullOrWhiteSpace(receiver.CountryCode))
{
pstlAdr.Ctry = receiver.CountryCode; // Index 2.77 / Country
}
}
}

Expand Down Expand Up @@ -242,7 +255,10 @@ public void AddTransaction(PaymentInstructionInformation3CH pmtInf, Receiver rec
}
}

cdtTrfTxInf.InstrForDbtrAgt = transaction.InstructionForDebtorAgent; // Index 2.85
if (!string.IsNullOrWhiteSpace(transaction.InstructionForDebtorAgent))
{
cdtTrfTxInf.InstrForDbtrAgt = transaction.InstructionForDebtorAgent; // Index 2.85
}

AddNewCreditTransferTransactionInformation(pmtInf, cdtTrfTxInf);
}
Expand Down
5 changes: 5 additions & 0 deletions iso20022-generator/iso20022-generator/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,11 @@ https://www.six-group.com/dam/download/banking-services/interbank-clearing/de/st


# Version Information
## 3.0.2 (2023-04-13)
- Split Street and StreetNumber into two properties
- Don't export postal adress properties if empty
- Don't export InstructionForDebtorAgent if empty

## 3.0.1 (2023-04-03)
- Corrected issue with unintentionally overriding of sender information

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ public class Initialization

private decimal _controlSum;
private string _contactDetailsName = "iso20022-Generator / enio AG";
private string _contactDetailsOther = "3.0.1";
private string _contactDetailsOther = "3.0.2";

public decimal ControlSum
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@
<PackageLicenseUrl></PackageLicenseUrl>
<PackageId>iso20022Generator</PackageId>
<Product>iso20022Generator</Product>
<Version>3.0.1</Version>
<Version>3.0.2</Version>
<Copyright>enio AG</Copyright>
<Description>This generator library helps you building iso 20022 artifacts with the minimum amount of information you need to set up valid documents. Currently pain.001 files are only supported.</Description>
<AssemblyVersion>3.0.1.0</AssemblyVersion>
<FileVersion>3.0.1.0</FileVersion>
<AssemblyVersion>3.0.2.0</AssemblyVersion>
<FileVersion>3.0.2.0</FileVersion>
<PackageLicenseFile>LICENSE.md</PackageLicenseFile>
<PackageReadmeFile>README.md</PackageReadmeFile>
</PropertyGroup>
Expand Down

0 comments on commit 48c3e94

Please sign in to comment.