Skip to content

Commit

Permalink
fix: mapping fixes for fxQuotes
Browse files Browse the repository at this point in the history
  • Loading branch information
oderayi authored Oct 14, 2024
2 parents 6b02250 + 073929e commit 6091067
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 15 deletions.
26 changes: 19 additions & 7 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down Expand Up @@ -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"
},
Expand Down
10 changes: 7 additions & 3 deletions src/mappings/fspiopiso20022/fxQuotes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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: `{
Expand Down Expand Up @@ -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",
Expand All @@ -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.ActiveCurrencyAndAmount": "body.conversionTerms.targetAmount.amount"
} as unknown as TransformObject,
putError: `{
"$noDefaults": "true",
Expand Down
12 changes: 9 additions & 3 deletions test/fixtures/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1110,7 +1110,7 @@ export const fspiopIso20022Sources = {
},
IntrBkSttlmAmt: {
Ccy: 'XXY',
ActiveOrHistoricCurrencyAndAmount: '23.55'
ActiveCurrencyAndAmount: '23.55'
},
ChrgBr: 'DEBT'
}
Expand Down Expand Up @@ -1864,12 +1864,18 @@ export const expectedFspiopIso20022Targets = (target: GenericObject) => ({
},
IntrBkSttlmAmt: {
Ccy: 'XXY',
ActiveOrHistoricCurrencyAndAmount: '23.55'
ActiveCurrencyAndAmount: '23.55'
},
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'
}
}
}
},
Expand Down

0 comments on commit 6091067

Please sign in to comment.