From d323bf9059449dc273a45a0445a7ed61a23a69a9 Mon Sep 17 00:00:00 2001 From: Steven Oderayi Date: Mon, 14 Oct 2024 16:49:17 +0100 Subject: [PATCH 1/4] fix: add NsgId, CreDtTm, NbOfTxs & SttlmMtd to PUT fxQuotes --- src/mappings/fspiopiso20022/fxQuotes.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/mappings/fspiopiso20022/fxQuotes.ts b/src/mappings/fspiopiso20022/fxQuotes.ts index 248d14fc..a0281378 100644 --- a/src/mappings/fspiopiso20022/fxQuotes.ts +++ b/src/mappings/fspiopiso20022/fxQuotes.ts @@ -86,6 +86,11 @@ export const fxQuotes_reverse = { } as unknown as TransformObject, put: { "$noDefaults": "true", + "body.GrpHdr.MsgId": { "$transform": "generateID" }, + "body.GrpHdr.CreDtTm": { "$transform": "datetimeNow" }, + "body.GrpHdr.NbOfTxs": { "$transform": "fixed", "value": "1" }, + "body.GrpHdr.SttlmInf.SttlmMtd": { "$transform": "fixed", "value": "CLRG" }, + "body.GrpHdr.PmtInstrXpryDtTm": "body.conversionTerms.expiration", "body.CdtTrfTxInf.VrfctnOfTerms.IlpV4PrepPacket.condition": "body.condition", "body.CdtTrfTxInf.VrfctnOfTerms.PmtId.InstrId": "body.conversionTerms.conversionId", "body.CdtTrfTxInf.PmtId.TxId": "body.conversionTerms.determiningTransferId", @@ -98,8 +103,7 @@ export const fxQuotes_reverse = { "body.CdtTrfTxInf.UndrlygCstmrCdtTrf.InstdAmt.Ccy": "body.conversionTerms.sourceAmount.currency", "body.CdtTrfTxInf.UndrlygCstmrCdtTrf.InstdAmt.ActiveOrHistoricCurrencyAndAmount": "body.conversionTerms.sourceAmount.amount", "body.CdtTrfTxInf.IntrBkSttlmAmt.Ccy": "body.conversionTerms.targetAmount.currency", - "body.CdtTrfTxInf.IntrBkSttlmAmt.ActiveOrHistoricCurrencyAndAmount": "body.conversionTerms.targetAmount.amount", - "body.GrpHdr.PmtInstrXpryDtTm": "body.conversionTerms.expiration" + "body.CdtTrfTxInf.IntrBkSttlmAmt.ActiveOrHistoricCurrencyAndAmount": "body.conversionTerms.targetAmount.amount" } as unknown as TransformObject, putError: `{ "$noDefaults": "true", From 79f450e2e20c49ace4f1dad4db540ff7cf8fd10b Mon Sep 17 00:00:00 2001 From: Steven Oderayi Date: Mon, 14 Oct 2024 16:54:39 +0100 Subject: [PATCH 2/4] test: update tests --- package-lock.json | 22 +++++++++++++++++----- package.json | 2 +- test/fixtures/index.ts | 8 +++++++- 3 files changed, 25 insertions(+), 7 deletions(-) diff --git a/package-lock.json b/package-lock.json index deb75658..46c147e5 100644 --- a/package-lock.json +++ b/package-lock.json @@ -10,7 +10,7 @@ "license": "Apache-2.0", "dependencies": { "@mojaloop/central-services-error-handling": "^13.0.1", - "@mojaloop/central-services-shared": "^18.9.0", + "@mojaloop/central-services-shared": "^18.10.0", "@mojaloop/sdk-standard-components": "^19.0.0", "map-transform-cjs": "^0.2.0" }, @@ -1336,9 +1336,9 @@ } }, "node_modules/@mojaloop/central-services-shared": { - "version": "18.9.0", - "resolved": "https://registry.npmjs.org/@mojaloop/central-services-shared/-/central-services-shared-18.9.0.tgz", - "integrity": "sha512-mv2QSSEv2chLWi/gWZmuJ3hBjgPnQyLFHR9thF42K1MqCFgEZUFKdJ8p8igial29jAwXSRsCEg0D6Eet6Qwv4g==", + "version": "18.10.0", + "resolved": "https://registry.npmjs.org/@mojaloop/central-services-shared/-/central-services-shared-18.10.0.tgz", + "integrity": "sha512-d4Pl5IBuA9a4kdmhGk7q9ojXa6z4UtGPIlPKCJvvpPps2YUGhzTlXKhregKeta3Qin0m6+9ajKQpzR4NFgbXyA==", "dependencies": { "@hapi/catbox": "12.1.1", "@hapi/catbox-memory": "5.0.1", @@ -1359,7 +1359,7 @@ "ulidx": "2.4.1", "uuid4": "2.0.3", "widdershins": "^4.0.1", - "yaml": "2.5.1" + "yaml": "2.6.0" }, "peerDependencies": { "@mojaloop/central-services-error-handling": ">=13.x.x", @@ -1390,6 +1390,17 @@ } } }, + "node_modules/@mojaloop/central-services-shared/node_modules/yaml": { + "version": "2.6.0", + "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.6.0.tgz", + "integrity": "sha512-a6ae//JvKDEra2kdi1qzCyrJW/WZCgFi8ydDV+eXExl95t+5R+ijnqHJbz9tmMh8FUjx3iv2fCQ4dclAQlO2UQ==", + "bin": { + "yaml": "bin.mjs" + }, + "engines": { + "node": ">= 14" + } + }, "node_modules/@mojaloop/event-sdk": { "version": "14.1.1", "resolved": "https://registry.npmjs.org/@mojaloop/event-sdk/-/event-sdk-14.1.1.tgz", @@ -14880,6 +14891,7 @@ "version": "2.5.1", "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.5.1.tgz", "integrity": "sha512-bLQOjaX/ADgQ20isPJRvF0iRUHIxVhYvr53Of7wGcWlO2jvtUlH5m87DsmulFVxRpNLOnI4tB6p/oh8D7kpn9Q==", + "dev": true, "bin": { "yaml": "bin.mjs" }, diff --git a/package.json b/package.json index fcd2a37a..38927b55 100644 --- a/package.json +++ b/package.json @@ -51,7 +51,7 @@ }, "dependencies": { "@mojaloop/central-services-error-handling": "^13.0.1", - "@mojaloop/central-services-shared": "^18.9.0", + "@mojaloop/central-services-shared": "^18.10.0", "@mojaloop/sdk-standard-components": "^19.0.0", "map-transform-cjs": "^0.2.0" }, diff --git a/test/fixtures/index.ts b/test/fixtures/index.ts index 92393632..b6d8aaa0 100644 --- a/test/fixtures/index.ts +++ b/test/fixtures/index.ts @@ -1869,7 +1869,13 @@ export const expectedFspiopIso20022Targets = (target: GenericObject) => ({ ChrgBr: 'DEBT' }, GrpHdr: { - PmtInstrXpryDtTm: '2016-05-24T08:38:08.699-04:00' + MsgId: getProp(target, 'body.GrpHdr.MsgId'), + CreDtTm: getProp(target, 'body.GrpHdr.CreDtTm'), + NbOfTxs: '1', + PmtInstrXpryDtTm: '2016-05-24T08:38:08.699-04:00', + SttlmInf: { + SttlmMtd: 'CLRG' + } } } }, From 817019ced5726a9d844a22efb1832b9f557887f2 Mon Sep 17 00:00:00 2001 From: Steven Oderayi Date: Mon, 14 Oct 2024 16:55:30 +0100 Subject: [PATCH 3/4] ci(snapshot): 0.1.1-snapshot.53 --- package-lock.json | 4 ++-- package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index 46c147e5..cce76a24 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@mojaloop/ml-schema-transformer-lib", - "version": "0.1.1-snapshot.52", + "version": "0.1.1-snapshot.53", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@mojaloop/ml-schema-transformer-lib", - "version": "0.1.1-snapshot.52", + "version": "0.1.1-snapshot.53", "license": "Apache-2.0", "dependencies": { "@mojaloop/central-services-error-handling": "^13.0.1", diff --git a/package.json b/package.json index 38927b55..a4287b16 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@mojaloop/ml-schema-transformer-lib", - "version": "0.1.1-snapshot.52", + "version": "0.1.1-snapshot.53", "description": "Shared component for ML schemas translation", "repository": { "type": "git", From 073929ee1deb6bc440edcda078203f2b81e84df6 Mon Sep 17 00:00:00 2001 From: Steven Oderayi Date: Mon, 14 Oct 2024 17:28:43 +0100 Subject: [PATCH 4/4] fix: fix PUT fxQuotes IntrBkSttlmAmt.ActiveCurrencyAndAmount --- src/mappings/fspiopiso20022/fxQuotes.ts | 4 ++-- test/fixtures/index.ts | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/mappings/fspiopiso20022/fxQuotes.ts b/src/mappings/fspiopiso20022/fxQuotes.ts index a0281378..8842d2c3 100644 --- a/src/mappings/fspiopiso20022/fxQuotes.ts +++ b/src/mappings/fspiopiso20022/fxQuotes.ts @@ -50,7 +50,7 @@ export const fxQuotes = { "body.conversionTerms.sourceAmount.currency": "body.CdtTrfTxInf.UndrlygCstmrCdtTrf.InstdAmt.Ccy", "body.conversionTerms.sourceAmount.amount": "body.CdtTrfTxInf.UndrlygCstmrCdtTrf.InstdAmt.ActiveOrHistoricCurrencyAndAmount", "body.conversionTerms.targetAmount.currency": "body.CdtTrfTxInf.IntrBkSttlmAmt.Ccy", - "body.conversionTerms.targetAmount.amount": "body.CdtTrfTxInf.IntrBkSttlmAmt.ActiveOrHistoricCurrencyAndAmount", + "body.conversionTerms.targetAmount.amount": "body.CdtTrfTxInf.IntrBkSttlmAmt.ActiveCurrencyAndAmount", "body.conversionTerms.expiration": "body.GrpHdr.PmtInstrXpryDtTm" } as unknown as TransformObject, putError: `{ @@ -103,7 +103,7 @@ export const fxQuotes_reverse = { "body.CdtTrfTxInf.UndrlygCstmrCdtTrf.InstdAmt.Ccy": "body.conversionTerms.sourceAmount.currency", "body.CdtTrfTxInf.UndrlygCstmrCdtTrf.InstdAmt.ActiveOrHistoricCurrencyAndAmount": "body.conversionTerms.sourceAmount.amount", "body.CdtTrfTxInf.IntrBkSttlmAmt.Ccy": "body.conversionTerms.targetAmount.currency", - "body.CdtTrfTxInf.IntrBkSttlmAmt.ActiveOrHistoricCurrencyAndAmount": "body.conversionTerms.targetAmount.amount" + "body.CdtTrfTxInf.IntrBkSttlmAmt.ActiveCurrencyAndAmount": "body.conversionTerms.targetAmount.amount" } as unknown as TransformObject, putError: `{ "$noDefaults": "true", diff --git a/test/fixtures/index.ts b/test/fixtures/index.ts index b6d8aaa0..07cae2a5 100644 --- a/test/fixtures/index.ts +++ b/test/fixtures/index.ts @@ -1110,7 +1110,7 @@ export const fspiopIso20022Sources = { }, IntrBkSttlmAmt: { Ccy: 'XXY', - ActiveOrHistoricCurrencyAndAmount: '23.55' + ActiveCurrencyAndAmount: '23.55' }, ChrgBr: 'DEBT' } @@ -1864,7 +1864,7 @@ export const expectedFspiopIso20022Targets = (target: GenericObject) => ({ }, IntrBkSttlmAmt: { Ccy: 'XXY', - ActiveOrHistoricCurrencyAndAmount: '23.55' + ActiveCurrencyAndAmount: '23.55' }, ChrgBr: 'DEBT' },