/* * This file is part of LibEuFin. * Copyright (C) 2024 Taler Systems S.A. * LibEuFin is free software; you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation; either version 3, or * (at your option) any later version. * LibEuFin is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General * Public License for more details. * You should have received a copy of the GNU Affero General Public * License along with LibEuFin; see the file COPYING. If not, see * */ // THIS FILE IS GENERATED, DO NOT EDIT package tech.libeufin.ebics.iso20022 import java.time.* import java.util.* import com.gitlab.mvysny.konsumexml.* data class AmendmentInformationDetails14( val OrgnlMndtId: String?, val OrgnlCdtrSchmeId: PartyIdentification135?, val OrgnlCdtrAgt: BranchAndFinancialInstitutionIdentification6?, val OrgnlCdtrAgtAcct: CashAccount40?, val OrgnlDbtr: PartyIdentification135?, val OrgnlDbtrAcct: CashAccount40?, val OrgnlDbtrAgt: BranchAndFinancialInstitutionIdentification6?, val OrgnlDbtrAgtAcct: CashAccount40?, val OrgnlFnlColltnDt: LocalDate?, val OrgnlFrqcy: Frequency36Choice?, val OrgnlRsn: MandateSetupReason1Choice?, val OrgnlTrckgDays: String?, ) { companion object { fun parse(k: Konsumer): AmendmentInformationDetails14 = AmendmentInformationDetails14( k.childOrNull("OrgnlMndtId") { text() }, k.childOrNull("OrgnlCdtrSchmeId") { PartyIdentification135.parse(this) }, k.childOrNull("OrgnlCdtrAgt") { BranchAndFinancialInstitutionIdentification6.parse(this) }, k.childOrNull("OrgnlCdtrAgtAcct") { CashAccount40.parse(this) }, k.childOrNull("OrgnlDbtr") { PartyIdentification135.parse(this) }, k.childOrNull("OrgnlDbtrAcct") { CashAccount40.parse(this) }, k.childOrNull("OrgnlDbtrAgt") { BranchAndFinancialInstitutionIdentification6.parse(this) }, k.childOrNull("OrgnlDbtrAgtAcct") { CashAccount40.parse(this) }, k.childOrNull("OrgnlFnlColltnDt") { text().toDate() }, k.childOrNull("OrgnlFrqcy") { Frequency36Choice.parse(this) }, k.childOrNull("OrgnlRsn") { MandateSetupReason1Choice.parse(this) }, k.childOrNull("OrgnlTrckgDays") { text() }, ) } } data class Charges12( val Amt: ActiveOrHistoricCurrencyAndAmount, val Agt: BranchAndFinancialInstitutionIdentification6, val Tp: ChargeType3Choice?, ) { companion object { fun parse(k: Konsumer): Charges12 = Charges12( k.child("Amt") { ActiveOrHistoricCurrencyAndAmount.parse(this) }, k.child("Agt") { BranchAndFinancialInstitutionIdentification6.parse(this) }, k.childOrNull("Tp") { ChargeType3Choice.parse(this) }, ) } } enum class ClearingChannel2Code { RTGS, RTNS, MPNS, BOOK, } sealed interface ClearingSystemIdentification3Choice { @JvmInline value class Cd(val value: ExternalCashClearingSystem1Code): ClearingSystemIdentification3Choice @JvmInline value class Prtry(val value: String): ClearingSystemIdentification3Choice companion object { fun parse(k: Konsumer): ClearingSystemIdentification3Choice = k.child(Names.of("Cd", "Prtry")) { when (localName) { "Cd" -> Cd(text().xmlCodeSet()) "Prtry" -> Prtry(text()) else -> throw Error("Impossible") } } } } data class CurrencyExchange13( val SrcCcy: String, val TrgtCcy: String, val XchgRate: Float, val UnitCcy: String?, ) { companion object { fun parse(k: Konsumer): CurrencyExchange13 = CurrencyExchange13( k.child("SrcCcy") { text() }, k.child("TrgtCcy") { text() }, k.child("XchgRate") { text().xmlFloat() }, k.childOrNull("UnitCcy") { text() }, ) } } data class CustomerPaymentStatusReportV13( val GrpHdr: GroupHeader86, val OrgnlGrpInfAndSts: OriginalGroupHeader17, val OrgnlPmtInfAndSts: List, val SplmtryData: List, ) { companion object { fun parse(k: Konsumer): CustomerPaymentStatusReportV13 = CustomerPaymentStatusReportV13( k.child("GrpHdr") { GroupHeader86.parse(this) }, k.child("OrgnlGrpInfAndSts") { OriginalGroupHeader17.parse(this) }, k.children("OrgnlPmtInfAndSts") { OriginalPaymentInstruction45.parse(this) }, k.children("SplmtryData") { SupplementaryData1.parse(this) }, ) } } data class pain_002_001_13( val CstmrPmtStsRpt: CustomerPaymentStatusReportV13, ) { companion object { fun parse(k: Konsumer): pain_002_001_13 = pain_002_001_13( k.child("CstmrPmtStsRpt") { CustomerPaymentStatusReportV13.parse(this) }, ) } } data class GroupHeader86( val MsgId: String, val CreDtTm: LocalDateTime, val InitgPty: PartyIdentification135?, val FwdgAgt: BranchAndFinancialInstitutionIdentification6?, val DbtrAgt: BranchAndFinancialInstitutionIdentification6?, val CdtrAgt: BranchAndFinancialInstitutionIdentification6?, ) { companion object { fun parse(k: Konsumer): GroupHeader86 = GroupHeader86( k.child("MsgId") { text() }, k.child("CreDtTm") { text().toDateTime() }, k.childOrNull("InitgPty") { PartyIdentification135.parse(this) }, k.childOrNull("FwdgAgt") { BranchAndFinancialInstitutionIdentification6.parse(this) }, k.childOrNull("DbtrAgt") { BranchAndFinancialInstitutionIdentification6.parse(this) }, k.childOrNull("CdtrAgt") { BranchAndFinancialInstitutionIdentification6.parse(this) }, ) } } sealed interface MandateRelatedData2Choice { @JvmInline value class DrctDbtMndt(val value: MandateRelatedInformation15): MandateRelatedData2Choice @JvmInline value class CdtTrfMndt(val value: CreditTransferMandateData1): MandateRelatedData2Choice companion object { fun parse(k: Konsumer): MandateRelatedData2Choice = k.child(Names.of("DrctDbtMndt", "CdtTrfMndt")) { when (localName) { "DrctDbtMndt" -> DrctDbtMndt(MandateRelatedInformation15.parse(this)) "CdtTrfMndt" -> CdtTrfMndt(CreditTransferMandateData1.parse(this)) else -> throw Error("Impossible") } } } } data class MandateRelatedInformation15( val MndtId: String?, val DtOfSgntr: LocalDate?, val AmdmntInd: Boolean?, val AmdmntInfDtls: AmendmentInformationDetails14?, val ElctrncSgntr: String?, val FrstColltnDt: LocalDate?, val FnlColltnDt: LocalDate?, val Frqcy: Frequency36Choice?, val Rsn: MandateSetupReason1Choice?, val TrckgDays: String?, ) { companion object { fun parse(k: Konsumer): MandateRelatedInformation15 = MandateRelatedInformation15( k.childOrNull("MndtId") { text() }, k.childOrNull("DtOfSgntr") { text().toDate() }, k.childOrNull("AmdmntInd") { text().xmlBoolean() }, k.childOrNull("AmdmntInfDtls") { AmendmentInformationDetails14.parse(this) }, k.childOrNull("ElctrncSgntr") { text() }, k.childOrNull("FrstColltnDt") { text().toDate() }, k.childOrNull("FnlColltnDt") { text().toDate() }, k.childOrNull("Frqcy") { Frequency36Choice.parse(this) }, k.childOrNull("Rsn") { MandateSetupReason1Choice.parse(this) }, k.childOrNull("TrckgDays") { text() }, ) } } data class NumberOfTransactionsPerStatus5( val DtldNbOfTxs: String, val DtldSts: ExternalPaymentTransactionStatus1Code, val DtldCtrlSum: Float?, ) { companion object { fun parse(k: Konsumer): NumberOfTransactionsPerStatus5 = NumberOfTransactionsPerStatus5( k.child("DtldNbOfTxs") { text() }, k.child("DtldSts") { text().xmlCodeSet() }, k.childOrNull("DtldCtrlSum") { text().xmlFloat() }, ) } } data class OriginalGroupHeader17( val OrgnlMsgId: String, val OrgnlMsgNmId: String, val OrgnlCreDtTm: LocalDateTime?, val OrgnlNbOfTxs: String?, val OrgnlCtrlSum: Float?, val GrpSts: ExternalPaymentGroupStatus1Code?, val StsRsnInf: List, val NbOfTxsPerSts: List, ) { companion object { fun parse(k: Konsumer): OriginalGroupHeader17 = OriginalGroupHeader17( k.child("OrgnlMsgId") { text() }, k.child("OrgnlMsgNmId") { text() }, k.childOrNull("OrgnlCreDtTm") { text().toDateTime() }, k.childOrNull("OrgnlNbOfTxs") { text() }, k.childOrNull("OrgnlCtrlSum") { text().xmlFloat() }, k.childOrNull("GrpSts") { text().xmlCodeSet() }, k.children("StsRsnInf") { StatusReasonInformation12.parse(this) }, k.children("NbOfTxsPerSts") { NumberOfTransactionsPerStatus5.parse(this) }, ) } } data class OriginalPaymentInstruction45( val OrgnlPmtInfId: String, val OrgnlNbOfTxs: String?, val OrgnlCtrlSum: Float?, val PmtInfSts: ExternalPaymentGroupStatus1Code?, val StsRsnInf: List, val NbOfTxsPerSts: List, val TxInfAndSts: List, ) { companion object { fun parse(k: Konsumer): OriginalPaymentInstruction45 = OriginalPaymentInstruction45( k.child("OrgnlPmtInfId") { text() }, k.childOrNull("OrgnlNbOfTxs") { text() }, k.childOrNull("OrgnlCtrlSum") { text().xmlFloat() }, k.childOrNull("PmtInfSts") { text().xmlCodeSet() }, k.children("StsRsnInf") { StatusReasonInformation12.parse(this) }, k.children("NbOfTxsPerSts") { NumberOfTransactionsPerStatus5.parse(this) }, k.children("TxInfAndSts") { PaymentTransaction144.parse(this) }, ) } } data class OriginalTransactionReference35( val IntrBkSttlmAmt: ActiveOrHistoricCurrencyAndAmount?, val Amt: AmountType4Choice?, val IntrBkSttlmDt: LocalDate?, val ReqdColltnDt: LocalDate?, val ReqdExctnDt: DateAndDateTime2Choice?, val CdtrSchmeId: PartyIdentification135?, val SttlmInf: SettlementInstruction11?, val PmtTpInf: PaymentTypeInformation27?, val PmtMtd: PaymentMethod4Code?, val MndtRltdInf: MandateRelatedData2Choice?, val RmtInf: RemittanceInformation21?, val UltmtDbtr: Party40Choice?, val Dbtr: Party40Choice?, val DbtrAcct: CashAccount40?, val DbtrAgt: BranchAndFinancialInstitutionIdentification6?, val DbtrAgtAcct: CashAccount40?, val CdtrAgt: BranchAndFinancialInstitutionIdentification6?, val CdtrAgtAcct: CashAccount40?, val Cdtr: Party40Choice?, val CdtrAcct: CashAccount40?, val UltmtCdtr: Party40Choice?, val Purp: Purpose2Choice?, ) { companion object { fun parse(k: Konsumer): OriginalTransactionReference35 = OriginalTransactionReference35( k.childOrNull("IntrBkSttlmAmt") { ActiveOrHistoricCurrencyAndAmount.parse(this) }, k.childOrNull("Amt") { AmountType4Choice.parse(this) }, k.childOrNull("IntrBkSttlmDt") { text().toDate() }, k.childOrNull("ReqdColltnDt") { text().toDate() }, k.childOrNull("ReqdExctnDt") { DateAndDateTime2Choice.parse(this) }, k.childOrNull("CdtrSchmeId") { PartyIdentification135.parse(this) }, k.childOrNull("SttlmInf") { SettlementInstruction11.parse(this) }, k.childOrNull("PmtTpInf") { PaymentTypeInformation27.parse(this) }, k.childOrNull("PmtMtd") { PaymentMethod4Code.valueOf(text()) }, k.childOrNull("MndtRltdInf") { MandateRelatedData2Choice.parse(this) }, k.childOrNull("RmtInf") { RemittanceInformation21.parse(this) }, k.childOrNull("UltmtDbtr") { Party40Choice.parse(this) }, k.childOrNull("Dbtr") { Party40Choice.parse(this) }, k.childOrNull("DbtrAcct") { CashAccount40.parse(this) }, k.childOrNull("DbtrAgt") { BranchAndFinancialInstitutionIdentification6.parse(this) }, k.childOrNull("DbtrAgtAcct") { CashAccount40.parse(this) }, k.childOrNull("CdtrAgt") { BranchAndFinancialInstitutionIdentification6.parse(this) }, k.childOrNull("CdtrAgtAcct") { CashAccount40.parse(this) }, k.childOrNull("Cdtr") { Party40Choice.parse(this) }, k.childOrNull("CdtrAcct") { CashAccount40.parse(this) }, k.childOrNull("UltmtCdtr") { Party40Choice.parse(this) }, k.childOrNull("Purp") { Purpose2Choice.parse(this) }, ) } } enum class PaymentMethod4Code { CHK, TRF, DD, TRA, } data class PaymentTransaction144( val StsId: String?, val OrgnlInstrId: String?, val OrgnlEndToEndId: String?, val OrgnlUETR: String?, val TxSts: ExternalPaymentTransactionStatus1Code?, val StsRsnInf: List, val ChrgsInf: List, val TrckrData: TrackerData1?, val AccptncDtTm: LocalDateTime?, val AcctSvcrRef: String?, val ClrSysRef: String?, val OrgnlTxRef: OriginalTransactionReference35?, val SplmtryData: List, ) { companion object { fun parse(k: Konsumer): PaymentTransaction144 = PaymentTransaction144( k.childOrNull("StsId") { text() }, k.childOrNull("OrgnlInstrId") { text() }, k.childOrNull("OrgnlEndToEndId") { text() }, k.childOrNull("OrgnlUETR") { text() }, k.childOrNull("TxSts") { text().xmlCodeSet() }, k.children("StsRsnInf") { StatusReasonInformation12.parse(this) }, k.children("ChrgsInf") { Charges12.parse(this) }, k.childOrNull("TrckrData") { TrackerData1.parse(this) }, k.childOrNull("AccptncDtTm") { text().toDateTime() }, k.childOrNull("AcctSvcrRef") { text() }, k.childOrNull("ClrSysRef") { text() }, k.childOrNull("OrgnlTxRef") { OriginalTransactionReference35.parse(this) }, k.children("SplmtryData") { SupplementaryData1.parse(this) }, ) } } data class PaymentTypeInformation27( val InstrPrty: Priority2Code?, val ClrChanl: ClearingChannel2Code?, val SvcLvl: List, val LclInstrm: LocalInstrument2Choice?, val SeqTp: SequenceType3Code?, val CtgyPurp: CategoryPurpose1Choice?, ) { companion object { fun parse(k: Konsumer): PaymentTypeInformation27 = PaymentTypeInformation27( k.childOrNull("InstrPrty") { Priority2Code.valueOf(text()) }, k.childOrNull("ClrChanl") { ClearingChannel2Code.valueOf(text()) }, k.children("SvcLvl") { ServiceLevel8Choice.parse(this) }, k.childOrNull("LclInstrm") { LocalInstrument2Choice.parse(this) }, k.childOrNull("SeqTp") { SequenceType3Code.valueOf(text()) }, k.childOrNull("CtgyPurp") { CategoryPurpose1Choice.parse(this) }, ) } } enum class SequenceType3Code { FRST, RCUR, FNAL, OOFF, RPRE, } data class SettlementInstruction11( val SttlmMtd: SettlementMethod1Code, val SttlmAcct: CashAccount40?, val ClrSys: ClearingSystemIdentification3Choice?, val InstgRmbrsmntAgt: BranchAndFinancialInstitutionIdentification6?, val InstgRmbrsmntAgtAcct: CashAccount40?, val InstdRmbrsmntAgt: BranchAndFinancialInstitutionIdentification6?, val InstdRmbrsmntAgtAcct: CashAccount40?, val ThrdRmbrsmntAgt: BranchAndFinancialInstitutionIdentification6?, val ThrdRmbrsmntAgtAcct: CashAccount40?, ) { companion object { fun parse(k: Konsumer): SettlementInstruction11 = SettlementInstruction11( k.child("SttlmMtd") { SettlementMethod1Code.valueOf(text()) }, k.childOrNull("SttlmAcct") { CashAccount40.parse(this) }, k.childOrNull("ClrSys") { ClearingSystemIdentification3Choice.parse(this) }, k.childOrNull("InstgRmbrsmntAgt") { BranchAndFinancialInstitutionIdentification6.parse(this) }, k.childOrNull("InstgRmbrsmntAgtAcct") { CashAccount40.parse(this) }, k.childOrNull("InstdRmbrsmntAgt") { BranchAndFinancialInstitutionIdentification6.parse(this) }, k.childOrNull("InstdRmbrsmntAgtAcct") { CashAccount40.parse(this) }, k.childOrNull("ThrdRmbrsmntAgt") { BranchAndFinancialInstitutionIdentification6.parse(this) }, k.childOrNull("ThrdRmbrsmntAgtAcct") { CashAccount40.parse(this) }, ) } } enum class SettlementMethod1Code { INDA, INGA, COVE, CLRG, } sealed interface StatusReason6Choice { @JvmInline value class Cd(val value: ExternalStatusReason1Code): StatusReason6Choice @JvmInline value class Prtry(val value: String): StatusReason6Choice companion object { fun parse(k: Konsumer): StatusReason6Choice = k.child(Names.of("Cd", "Prtry")) { when (localName) { "Cd" -> Cd(text().xmlCodeSet()) "Prtry" -> Prtry(text()) else -> throw Error("Impossible") } } } } data class StatusReasonInformation12( val Orgtr: PartyIdentification135?, val Rsn: StatusReason6Choice?, val AddtlInf: List, ) { companion object { fun parse(k: Konsumer): StatusReasonInformation12 = StatusReasonInformation12( k.childOrNull("Orgtr") { PartyIdentification135.parse(this) }, k.childOrNull("Rsn") { StatusReason6Choice.parse(this) }, k.children("AddtlInf") { text() }, ) } } data class TrackerData1( val ConfdDt: DateAndDateTime2Choice, val ConfdAmt: ActiveCurrencyAndAmount, val TrckrRcrd: List, ) { companion object { fun parse(k: Konsumer): TrackerData1 = TrackerData1( k.child("ConfdDt") { DateAndDateTime2Choice.parse(this) }, k.child("ConfdAmt") { ActiveCurrencyAndAmount.parse(this) }, k.children("TrckrRcrd", minCount=1, ) { TrackerRecord1.parse(this) }, ) } } data class TrackerRecord1( val Agt: BranchAndFinancialInstitutionIdentification6, val ChrgBr: ChargeBearerType1Code?, val ChrgsAmt: ActiveCurrencyAndAmount?, val XchgRateData: CurrencyExchange13?, ) { companion object { fun parse(k: Konsumer): TrackerRecord1 = TrackerRecord1( k.child("Agt") { BranchAndFinancialInstitutionIdentification6.parse(this) }, k.childOrNull("ChrgBr") { ChargeBearerType1Code.valueOf(text()) }, k.childOrNull("ChrgsAmt") { ActiveCurrencyAndAmount.parse(this) }, k.childOrNull("XchgRateData") { CurrencyExchange13.parse(this) }, ) } }