Skip to content

Commit

Permalink
feat(3574): added FX endpoints to seeds (#989)
Browse files Browse the repository at this point in the history
  • Loading branch information
geka-evk authored Nov 17, 2023
1 parent 0062b7a commit 07f2888
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 12 deletions.
14 changes: 7 additions & 7 deletions package-lock.json

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

6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,9 @@
"scripts": {
"start": "npm run start:api",
"start:api": "node src/api/index.js",
"start:debug": "npm run start:api --node-options --inspect=0.0.0.0",
"watch:api": "npx nodemon src/api/index.js",
"start:handlers": "node src/handlers/index.js",
"start:debug": "npm start --node-options --inspect=0.0.0.0",
"watch:api": "npx nodemon src/api/index.js",
"dev": "npm run docker:stop && docker-compose -f docker-compose.yml -f docker-compose.dev.yml up --build -d",
"lint": "npx standard",
"lint:fix": "npx standard --fix",
Expand Down Expand Up @@ -90,7 +90,7 @@
"@mojaloop/central-services-health": "14.0.2",
"@mojaloop/central-services-logger": "11.2.2",
"@mojaloop/central-services-metrics": "12.0.8",
"@mojaloop/central-services-shared": "^18.2.0-snapshot.5",
"@mojaloop/central-services-shared": "^18.2.0-snapshot.6",
"@mojaloop/central-services-stream": "11.2.0",
"@mojaloop/database-lib": "11.0.3",
"@mojaloop/event-sdk": "14.0.0",
Expand Down
14 changes: 14 additions & 0 deletions seeds/endpointType.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@

'use strict'

const { FspEndpointTypes } = require('@mojaloop/central-services-shared').Enum.EndPoints

const endpointTypes = [
{
name: 'ALARM_NOTIFICATION_URL',
Expand All @@ -46,6 +48,18 @@ const endpointTypes = [
name: 'FSPIOP_CALLBACK_URL_TRANSFER_ERROR',
description: 'Participant callback URL to which transfer error notifications can be sent'
},
{
name: FspEndpointTypes.FSPIOP_CALLBACK_URL_FX_TRANSFER_POST,
description: 'Participant callback URL to which FX transfer post can be sent'
},
{
name: FspEndpointTypes.FSPIOP_CALLBACK_URL_FX_TRANSFER_PUT,
description: 'Participant callback URL to which FX transfer put can be sent'
},
{
name: FspEndpointTypes.FSPIOP_CALLBACK_URL_FX_TRANSFER_ERROR,
description: 'Participant callback URL to which FX transfer error notifications can be sent'
},
{
name: 'NET_DEBIT_CAP_THRESHOLD_BREACH_EMAIL',
description: 'Participant/Hub operator email address to which the net debit cap breach e-mail notification can be sent'
Expand Down
6 changes: 4 additions & 2 deletions src/models/participant/facade.js
Original file line number Diff line number Diff line change
Expand Up @@ -260,8 +260,10 @@ const addEndpoint = async (participantId, endpoint) => {
const knex = Db.getKnex()
return knex.transaction(async trx => {
try {
const endpointType = await knex('endpointType').where({ name: endpoint.type, isActive: 1 }).select('endpointTypeId').first()
// let endpointType = await trx.first('endpointTypeId').from('endpointType').where({ 'name': endpoint.type, 'isActive': 1 })
const endpointType = await knex('endpointType').where({
name: endpoint.type,
isActive: 1
}).select('endpointTypeId').first()

const existingEndpoint = await knex('participantEndpoint').transacting(trx).forUpdate().select('*')
.where({
Expand Down

0 comments on commit 07f2888

Please sign in to comment.