libeufin

Integration and sandbox testing for FinTech APIs and data formats
Log | Files | Refs | Submodules | README | LICENSE

commit cf46a7bca60499922fbaaea0e8e05606a8c008d4
parent 336568dc7e9d70e14c12e69e5b3b448968f70065
Author: Antoine A <>
Date:   Wed, 14 Aug 2024 13:00:50 +0200

nexus: update iso20022 code sets

Diffstat:
Mnexus/codegen.py | 20++++++++++++++------
Mnexus/src/main/kotlin/tech/libeufin/nexus/Iso20022CodeSets.kt | 15+++++++++++++++
2 files changed, 29 insertions(+), 6 deletions(-)

diff --git a/nexus/codegen.py b/nexus/codegen.py @@ -1,10 +1,12 @@ +#!/usr/bin/python3 # Update EBICS constants file using latest external code sets files -import polars as pl -import requests from io import BytesIO from zipfile import ZipFile +import polars as pl +import requests + def iso20022codegen(): # Get XLSX zip file from server @@ -17,19 +19,24 @@ def iso20022codegen(): zip = ZipFile(BytesIO(r.content)) files = zip.namelist() assert len(files) == 1 - file = zip.open(files[0]) + bytes = zip.read(files[0]) # Parse excel - df = pl.read_excel(file, sheet_name="AllCodeSets") + df = pl.read_excel(bytes, sheet_name="AllCodeSets") def extractCodeSet(setName: str, className: str) -> str: out = f"enum class {className}(val isoCode: String, val description: String) {{" - for row in df.filter(pl.col("Code Set") == setName).sort("Code Value").rows(named=True): + for row in ( + df.filter(pl.col("Code Set") == setName).sort("Code Value").rows(named=True) + ): (value, isoCode, description) = ( row["Code Value"], row["Code Name"], - row["Code Definition"].split("\n", 1)[0].strip(), + row["Code Definition"] + .split("\n", 1)[0] + .rstrip() + .replace("_x000D_", ""), ) out += f'\n\t{value}("{isoCode}", "{description}"),' @@ -72,4 +79,5 @@ package tech.libeufin.nexus with open("src/main/kotlin/tech/libeufin/nexus/Iso20022CodeSets.kt", "w") as file1: file1.write(kt) + iso20022codegen() diff --git a/nexus/src/main/kotlin/tech/libeufin/nexus/Iso20022CodeSets.kt b/nexus/src/main/kotlin/tech/libeufin/nexus/Iso20022CodeSets.kt @@ -33,6 +33,11 @@ enum class ExternalStatusReasonCode(val isoCode: String, val description: String AB09("ErrorCreditorAgent", "Transaction stopped due to error at the Creditor Agent."), AB10("ErrorInstructedAgent", "Transaction stopped due to error at the Instructed Agent."), AB11("TimeoutDebtorAgent", "Transaction stopped due to timeout at the Debtor Agent."), + AB12("InvalidConcurrentBatch", "Duplicate Concurrent Batch Sequence number– for Settlement Instructions."), + AB13("InvalidRoutingCodeUtilised", "Wrong Message Routing Type for Return-of-Funds."), + AB15("InvalidAccountNumberForSettlementType", "Instruction may not be placed on the Continuous Processing Line settlement processor."), + AB21("InvalidSettlementAgreementNumberSpecified", "Agreement number not valid (beneficiary)."), + AB26("InvalidBatchSettlementInstruction", "Settlement Instruction does not exist."), AC01("IncorrectAccountNumber", "Account number is invalid or missing."), AC02("InvalidDebtorAccountNumber", "Debtor account number invalid or missing"), AC03("InvalidCreditorAccountNumber", "Creditor account number invalid or missing"), @@ -91,6 +96,7 @@ enum class ExternalStatusReasonCode(val isoCode: String, val description: String ARFR("AlreadyRefusedRTP", "Request-to-pay has already been refused by the Debtor."), ARJR("AlreadyRejectedRTP", "Request-to-pay has already been rejected."), ATNS("AttachementsNotSupported", "Attachments to the request-to-pay are not supported."), + BDAY("NotBusinessDay", "Settlement Cycle Day and Calendar day should be the same."), BE01("InconsistenWithEndCustomer", "Identification of end customer is not consistent with associated account number. (formerly CreditorConsistency)."), BE04("MissingCreditorAddress", "Specification of creditor's address, which is required for payment, is missing/not correct (formerly IncorrectCreditorAddress)."), BE05("UnrecognisedInitiatingParty", "Party who initiated the message is not recognised by the end customer"), @@ -172,6 +178,7 @@ enum class ExternalStatusReasonCode(val isoCode: String, val description: String DS25("OrderFileDeleted", "The order file was deleted by the bank server"), DS26("UserSignedMultipleTimes", "The same user has signed multiple times"), DS27("UserNotYetActivated", "The user is not yet activated (technically)"), + DS28("ReturnForTechnicalReason", "Message routed to the wrong environment."), DT01("InvalidDate", "Invalid date (eg, wrong or missing settlement date)"), DT02("InvalidCreationDate", "Invalid creation date and time in Group Header (eg, historic date)"), DT03("InvalidNonProcessingDate", "Invalid non bank processing date (eg, weekend or local public holiday)"), @@ -216,12 +223,15 @@ enum class ExternalStatusReasonCode(val isoCode: String, val description: String G006("DeliveredWIthoutServiceLevel", "Payment has been delivered to creditor agent without service level."), ID01("CorrespondingOriginalFileStillNotSent", "Signature file was sent to the bank but the corresponding original file has not been sent yet."), IEDT("IncorrectExpiryDateTime", "Expiry date time of the request-to-pay is incorrect."), + INDT("InvalidDetails", "Details not valid for this field."), IRNR("InitialRTPNeverReceived", "No initial request-to-pay has been received."), + ISWS("InvalidSettlementWindow", "Cannot schedule instruction for Night Window."), MD01("NoMandate", "No Mandate"), MD02("MissingMandatoryInformationInMandate", "Mandate related information data required by the scheme is missing."), MD05("CollectionNotDue", "Creditor or creditor's agent should not have collected the direct debit"), MD06("RefundRequestByEndCustomer", "Return of funds requested by end customer"), MD07("EndCustomerDeceased", "End customer is deceased."), + MINF("MissingInformation", "Information missing for the field or cannot be empty."), MS02("NotSpecifiedReasonCustomerGenerated", "Reason has not been specified by end customer"), MS03("NotSpecifiedReasonAgentGenerated", "Reason has not been specified by agent."), NARR("Narrative", "Reason is provided as narrative information in the additional reason information."), @@ -229,6 +239,7 @@ enum class ExternalStatusReasonCode(val isoCode: String, val description: String NOAR("NonAgreedRTP", "No existing agreement for receiving request-to-pay messages."), NOAS("NoAnswerFromCustomer", "No response from Beneficiary."), NOCM("NotCompliantGeneric", "Customer account is not compliant with regulatory requirements, for example FICA (in South Africa) or any other regulatory requirements which render an account inactive for certain processing."), + NOFR("OutstandingFundingForSettlement", "Continuous Processing Line on Hold Instruction."), NOPG("NoPaymentGuarantee", "Requested payment guarantee (by Creditor) related to a request-to-pay cannot be provided."), NRCH("PayerOrPayerRTPSPNotReachable", "Recipient side of the request-to-pay (payer or its request-to-pay service provider) is not reachable."), PINS("TypeOfPaymentInstrumentNotSupported", "Type of payment requested in the request-to-pay is not supported by the payer."), @@ -244,6 +255,9 @@ enum class ExternalStatusReasonCode(val isoCode: String, val description: String RC10("InvalidCreditorClearingSystemMemberIdentifier", "Creditor ClearingSystemMember identifier is invalid or missing"), RC11("InvalidIntermediaryAgent", "Intermediary Agent is invalid or missing"), RC12("MissingCreditorSchemeId", "Creditor Scheme Id is invalid or missing"), + RC13("ParticipantNotAnActiveMemberofRTGS", "Originator not active any more."), + RC15("ParticipantNotActiveMemberSettlementType", "Settlement agreement required."), + RC16("ParticipantNotActiveMemberofSADCRTGS", "Participant blocked from SADC-RTGS."), RCON("RMessageConflict", "Conflict with R-Message"), RECI("ReceiverCustomerInformation", "Further information regarding the intended recipient."), REPR("RTPReceivedCanBeProcessed", "Request-to-pay has been received and can be processed further."), @@ -267,6 +281,7 @@ enum class ExternalStatusReasonCode(val isoCode: String, val description: String S002("NetworkStopOfUETR", "Unique End-to-end Transaction Reference (UETR) relating to a payment has been prevent from traveling across a messaging network."), S003("RequestForCancellationForwarded", "Request for Cancellation has been forwarded to the payment processing/last payment processing agent."), S004("RequestForCancellationDeliveryAcknowledgement", "Request for Cancellation has been acknowledged as delivered to payment processing/last payment processing agent."), + SBRN("SettlementBatchRemovalNotification", "Remove Concurrent Batch Processing Line on hold instruction."), SL01("SpecificServiceOfferedByDebtorAgent", "Due to specific service offered by the Debtor Agent."), SL02("SpecificServiceOfferedByCreditorAgent", "Due to specific service offered by the Creditor Agent."), SL03("ServiceofClearingSystem", "Due to a specific service offered by the clearing system."),