@@ -892,7 +892,7 @@ describe('CamtParser', () => {
892892 expect ( transaction . customerReference ) . toBe ( 'VG 2025 QUARTAL IV' ) ;
893893 expect ( transaction . bankReference ) . toBe ( 'TXN003' ) ;
894894 expect ( transaction . purpose ) . toBe (
895- '28,65EUR EREF: VG 2025 QUARTAL IV IBAN: DE12345678901234567891 BIC: BANKABC1XXX' ,
895+ '28,65EUR EREF: VG 2025 QUARTAL IV IBAN\n : DE12345678901234567891 BIC: BANKABC1XXX' ,
896896 ) ;
897897 expect ( transaction . remoteName ) . toBe ( 'ABC Bank' ) ;
898898 expect ( transaction . remoteAccountNumber ) . toBe ( 'DE12345678901234567891' ) ;
@@ -924,4 +924,145 @@ describe('CamtParser', () => {
924924 expect ( transaction . client ) . toBeUndefined ( ) ;
925925 expect ( transaction . textKeyExtension ) . toBeUndefined ( ) ;
926926 } ) ;
927+
928+ it ( 'should handle full iso date time in value date' , ( ) => {
929+ // this is an example from comdirect bank in 2026-01
930+ const camtXml = `<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
931+ <Document xmlns="urn:iso:std:iso:20022:tech:xsd:camt.052.001.02">
932+ <BkToCstmrAcctRpt>
933+ <GrpHdr>
934+ <MsgId>BD5F4D36X95740C4B89D967367217C16</MsgId>
935+ <CreDtTm>2026-01-22T10:35:25.369+01:00</CreDtTm>
936+ <MsgPgntn>
937+ <PgNb>0</PgNb>
938+ <LastPgInd>true</LastPgInd>
939+ </MsgPgntn>
940+ </GrpHdr>
941+ <Rpt>
942+ <Id>563916B991DD4EB18894EF4ABB730A5C</Id>
943+ <FrToDt>
944+ <FrDtTm>2025-12-10T00:00:00.000+01:00</FrDtTm>
945+ <ToDtTm>2026-01-22T00:00:00.000+01:00</ToDtTm>
946+ </FrToDt>
947+ <Acct>
948+ <Id>
949+ <IBAN>DE06940594210000027227</IBAN>
950+ </Id>
951+ </Acct>
952+ <Bal>
953+ <Tp>
954+ <CdOrPrtry>
955+ <Cd>OPBD</Cd>
956+ </CdOrPrtry>
957+ </Tp>
958+ <Amt Ccy="EUR">94.010000000021</Amt>
959+ <CdtDbtInd>CRDT</CdtDbtInd>
960+ <Dt>
961+ <DtTm>2025-12-10T00:00:00.000+01:00</DtTm>
962+ </Dt>
963+ </Bal>
964+ <Bal>
965+ <Tp>
966+ <CdOrPrtry>
967+ <Cd>CLBD</Cd>
968+ </CdOrPrtry>
969+ </Tp>
970+ <Amt Ccy="EUR">101.960000000017</Amt>
971+ <CdtDbtInd>CRDT</CdtDbtInd>
972+ <Dt>
973+ <DtTm>2026-01-22T00:00:00.000+01:00</DtTm>
974+ </Dt>
975+ </Bal>
976+ <Ntry>
977+ <NtryRef>5J3C21XL0470L56V/39761</NtryRef>
978+ <Amt Ccy="EUR">101.5</Amt>
979+ <CdtDbtInd>DBIT</CdtDbtInd>
980+ <Sts>BOOK</Sts>
981+ <BookgDt>
982+ <Dt>2025-12-08-01:00</Dt>
983+ </BookgDt>
984+ <ValDt>
985+ <DtTm>2025-12-10T00:00:00.000-01:00</DtTm>
986+ </ValDt>
987+ <AcctSvcrRef>5J2C21XL0470L56V/39761</AcctSvcrRef>
988+ <BkTxCd>
989+ <Prtry>
990+ <Cd>005</Cd>
991+ <Issr></Issr>
992+ </Prtry>
993+ </BkTxCd>
994+ <NtryDtls>
995+ <TxDtls>
996+ <RltdPties>
997+ <Cdtr>
998+ <Nm>AMAZON EU S.A R.L., NIEDERL ASSUNG DEUTSCHLAND</Nm>
999+ </Cdtr>
1000+ <CdtrAcct>
1001+ <Id/>
1002+ </CdtrAcct>
1003+ </RltdPties>
1004+ <RmtInf>
1005+ <Ustrd>028-1234567-XXXXXXX Amazon.de 2ABCD</Ustrd>
1006+ <Ustrd>EF9GFP28</Ustrd>
1007+ <Ustrd>End-to-End-Ref.:</Ustrd>
1008+ <Ustrd>2ABCDEF9GHIJKL28</Ustrd>
1009+ <Ustrd>CORE / Mandatsref.:</Ustrd>
1010+ <Ustrd>7829857lkklag</Ustrd>
1011+ <Ustrd>Gläubiger-ID:</Ustrd>
1012+ <Ustrd>DE24ABC00000123456</Ustrd>
1013+ </RmtInf>
1014+ </TxDtls>
1015+ </NtryDtls>
1016+ </Ntry>
1017+ </Rpt>
1018+ </BkToCstmrAcctRpt>
1019+ </Document>
1020+ ` ;
1021+
1022+ const parser = new CamtParser ( camtXml ) ;
1023+ const statements = parser . parse ( ) ;
1024+
1025+ expect ( statements ) . toHaveLength ( 1 ) ;
1026+ const statement = statements [ 0 ] ;
1027+ expect ( statement . transactions ) . toHaveLength ( 1 ) ;
1028+
1029+ const transaction = statement . transactions [ 0 ] ;
1030+
1031+ // Check all Transaction fields filled by the parser
1032+ expect ( transaction . amount ) . toBe ( - 101.5 ) ;
1033+ expect ( transaction . customerReference ) . toBe ( '' ) ;
1034+ expect ( transaction . bankReference ) . toBe ( '5J2C21XL0470L56V/39761' ) ;
1035+ expect ( transaction . purpose ) . toBe (
1036+ '028-1234567-XXXXXXX Amazon.de 2ABCD\nEF9GFP28\nEnd-to-End-Ref.:\n2ABCDEF9GHIJKL28\nCORE / Mandatsref.:\n7829857lkklag\nGläubiger-ID:\nDE24ABC00000123456' ,
1037+ ) ;
1038+ expect ( transaction . remoteName ) . toBe ( 'AMAZON EU S.A R.L., NIEDERL ASSUNG DEUTSCHLAND' ) ;
1039+ expect ( transaction . remoteAccountNumber ) . toBe ( '' ) ;
1040+ expect ( transaction . remoteBankId ) . toBe ( '' ) ;
1041+ expect ( transaction . e2eReference ) . toBe ( '' ) ;
1042+
1043+ // Check date fields
1044+ expect ( transaction . valueDate ) . toBeInstanceOf ( Date ) ;
1045+ expect ( transaction . valueDate . getFullYear ( ) ) . toBe ( 2025 ) ;
1046+ expect ( transaction . valueDate . getMonth ( ) ) . toBe ( 11 ) ; // November (0-based)
1047+ expect ( transaction . valueDate . getUTCDate ( ) ) . toBe ( 10 ) ;
1048+ expect ( transaction . entryDate ) . toBeInstanceOf ( Date ) ;
1049+ expect ( transaction . entryDate . getFullYear ( ) ) . toBe ( 2025 ) ;
1050+ expect ( transaction . entryDate . getMonth ( ) ) . toBe ( 11 ) ; // November (0-based)
1051+ expect ( transaction . entryDate . getUTCDate ( ) ) . toBe ( 8 ) ;
1052+
1053+ // Check transaction type and code fields
1054+ expect ( transaction . fundsCode ) . toBe ( 'DBIT' ) ;
1055+ expect ( transaction . transactionType ) . toBe ( '' ) ;
1056+ expect ( transaction . transactionCode ) . toBe ( '' ) ;
1057+
1058+ // Check additional information fields
1059+ expect ( transaction . additionalInformation ) . toBe ( '' ) ;
1060+ expect ( transaction . bookingText ) . toBe ( '' ) ; // Should match additionalInformation
1061+
1062+ // Verify optional fields not set in this test
1063+ expect ( transaction . primeNotesNr ) . toBeUndefined ( ) ;
1064+ expect ( transaction . remoteIdentifier ) . toBeUndefined ( ) ;
1065+ expect ( transaction . client ) . toBeUndefined ( ) ;
1066+ expect ( transaction . textKeyExtension ) . toBeUndefined ( ) ;
1067+ } ) ;
9271068} ) ;
0 commit comments