account-lookup-service 17.0.3 → 17.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (122) hide show
  1. package/.circleci/config.yml +2 -1
  2. package/CHANGELOG.md +24 -0
  3. package/docker-compose.yml +8 -2
  4. package/jest.config.js +1 -0
  5. package/migrations/01_currency.js +5 -5
  6. package/migrations/02_endpointType.js +5 -5
  7. package/migrations/03_endpointType-indexes.js +5 -5
  8. package/migrations/04_partyIdType.js +5 -5
  9. package/migrations/05_partyIdType-indexes.js +5 -5
  10. package/migrations/08_oracleEndpoint.js +5 -5
  11. package/migrations/09_oracleEndpoint-indexes.js +5 -5
  12. package/migrations/10_oracleEndpoint-remove-constraints.js +5 -5
  13. package/package.json +17 -16
  14. package/scripts/_wait4_all.js +3 -1
  15. package/seeds/currency.js +5 -5
  16. package/seeds/endpointType.js +4 -4
  17. package/seeds/partyIdType.js +4 -4
  18. package/src/api/endpointcache.js +4 -4
  19. package/src/api/health.js +4 -4
  20. package/src/api/index.js +4 -4
  21. package/src/api/oracles/{ID}.js +31 -6
  22. package/src/api/oracles.js +33 -7
  23. package/src/api/participants/{ID}/error.js +5 -5
  24. package/src/api/participants/{ID}.js +5 -5
  25. package/src/api/participants/{Type}/{ID}/error.js +22 -6
  26. package/src/api/participants/{Type}/{ID}/{SubId}/error.js +5 -5
  27. package/src/api/participants/{Type}/{ID}/{SubId}.js +99 -5
  28. package/src/api/participants/{Type}/{ID}.js +83 -10
  29. package/src/api/participants.js +19 -6
  30. package/src/api/parties/{Type}/{ID}/error.js +20 -6
  31. package/src/api/parties/{Type}/{ID}/{SubId}/error.js +32 -7
  32. package/src/api/parties/{Type}/{ID}/{SubId}.js +55 -7
  33. package/src/api/parties/{Type}/{ID}.js +37 -10
  34. package/src/api/routes.js +5 -5
  35. package/src/domain/oracle/index.js +5 -5
  36. package/src/domain/oracle/oracle.js +11 -45
  37. package/src/domain/participants/index.js +5 -5
  38. package/src/domain/participants/participants.js +20 -59
  39. package/src/domain/parties/getPartiesByTypeAndID.js +9 -14
  40. package/src/domain/parties/index.js +5 -5
  41. package/src/domain/parties/parties.js +12 -23
  42. package/src/domain/timeout/dto.js +14 -2
  43. package/src/domain/timeout/index.js +6 -12
  44. package/src/handlers/TimeoutHandler.js +3 -3
  45. package/src/handlers/index.js +3 -3
  46. package/src/handlers/register.js +3 -3
  47. package/src/index.js +4 -4
  48. package/src/interface/admin-swagger.yaml +4 -0
  49. package/src/interface/admin_swagger.json +902 -900
  50. package/src/interface/api_swagger.json +2824 -2824
  51. package/src/interface/thirdparty/admin-swagger.yaml +2 -2
  52. package/src/interface/thirdparty/admin_swagger.json +902 -902
  53. package/src/interface/thirdparty/api_swagger.json +2917 -2917
  54. package/src/lib/argv.js +5 -5
  55. package/src/lib/cache.js +5 -5
  56. package/src/lib/config.js +5 -5
  57. package/src/lib/db.js +5 -5
  58. package/src/lib/headers.js +5 -5
  59. package/src/lib/healthCheck/subServiceHealth.js +5 -5
  60. package/src/lib/util.js +20 -2
  61. package/src/models/currency/currency.js +7 -16
  62. package/src/models/currency/index.js +5 -5
  63. package/src/models/endpointType/endpointType.js +7 -16
  64. package/src/models/endpointType/index.js +5 -5
  65. package/src/models/misc/migrationLock.js +5 -5
  66. package/src/models/oracle/facade.js +5 -5
  67. package/src/models/oracle/index.js +5 -5
  68. package/src/models/oracle/oracleEndpoint.js +17 -71
  69. package/src/models/oracle/oracleEndpointCached.js +5 -5
  70. package/src/models/participantEndpoint/facade.js +5 -5
  71. package/src/models/partyIdType/index.js +5 -5
  72. package/src/models/partyIdType/partyIdType.js +7 -16
  73. package/src/plugins.js +4 -4
  74. package/src/server.js +8 -12
  75. package/test/integration/api/parties.test.js +5 -5
  76. package/test/integration/domain/oracle/index.test.js +23 -5
  77. package/test/integration/domain/timeout/index.test.js +1 -1
  78. package/test/integration/models/currency/currency.test.js +5 -5
  79. package/test/integration/plugins.test.js +5 -5
  80. package/test/unit/api/health.test.js +5 -5
  81. package/test/unit/api/oracles/{ID}.test.js +5 -5
  82. package/test/unit/api/oracles.test.js +5 -5
  83. package/test/unit/api/participants/participants.test.js +5 -5
  84. package/test/unit/api/participants/{Type}/{ID}/error.test.js +7 -5
  85. package/test/unit/api/participants/{Type}/{ID}/{SubId}/error.test.js +5 -5
  86. package/test/unit/api/participants/{Type}/{ID}/{SubId}.test.js +5 -5
  87. package/test/unit/api/participants/{Type}/{ID}.test.js +5 -5
  88. package/test/unit/api/participants.test.js +5 -5
  89. package/test/unit/api/parties/endpointcache.test.js +5 -5
  90. package/test/unit/api/parties/parties.test.js +5 -5
  91. package/test/unit/api/parties/{Type}/{ID}/error.test.js +8 -6
  92. package/test/unit/api/parties/{Type}/{ID}/{SubId}/error.test.js +15 -5
  93. package/test/unit/api/parties/{Type}/{ID}/{SubId}.test.js +5 -5
  94. package/test/unit/api/parties/{Type}/{ID}.test.js +5 -5
  95. package/test/unit/domain/oracle/oracle.test.js +5 -5
  96. package/test/unit/domain/participants/participants.test.js +6 -6
  97. package/test/unit/domain/parties/parties.test.js +8 -8
  98. package/test/unit/domain/parties/utils.test.js +5 -5
  99. package/test/unit/domain/timeout/index.test.js +3 -3
  100. package/test/unit/handlers/TimeoutHandler.test.js +3 -3
  101. package/test/unit/handlers/index.test.js +3 -3
  102. package/test/unit/handlers/register.test.js +3 -3
  103. package/test/unit/index.test.js +5 -5
  104. package/test/unit/iso20022/partiesValidation.test.js +5 -5
  105. package/test/unit/lib/argv.test.js +5 -5
  106. package/test/unit/lib/config.test.js +5 -5
  107. package/test/unit/lib/healthCheck/subServiceHealth.test.js +5 -5
  108. package/test/unit/lib/migrator.test.js +5 -5
  109. package/test/unit/lib/util.test.js +5 -5
  110. package/test/unit/mocks.js +3 -3
  111. package/test/unit/models/currency/currency.test.js +5 -5
  112. package/test/unit/models/endpointType/endpointType.test.js +5 -5
  113. package/test/unit/models/misc/migrationLock.test.js +5 -5
  114. package/test/unit/models/oracle/facade.test.js +5 -5
  115. package/test/unit/models/oracle/oracleEndpoint.test.js +5 -5
  116. package/test/unit/models/oracle/oracleEndpointCached.test.js +5 -5
  117. package/test/unit/models/participantEndpoint/facade.test.js +5 -5
  118. package/test/unit/models/partyIdType/partyIdType.test.js +5 -5
  119. package/test/unit/plugins.test.js +5 -5
  120. package/test/util/helper.js +5 -5
  121. package/test/util/mockgen.js +5 -5
  122. package/test/util/testConfig.js +5 -5
@@ -1,8 +1,8 @@
1
1
  /*****
2
2
  License
3
3
  --------------
4
- Copyright © 2017 Bill & Melinda Gates Foundation
5
- The Mojaloop files are made available by the Bill & Melinda Gates Foundation under the Apache License, Version 2.0 (the "License") and you may not use these files except in compliance with the License. You may obtain a copy of the License at
4
+ Copyright © 2020-2025 Mojaloop Foundation
5
+ The Mojaloop files are made available by the 2020-2025 Mojaloop Foundation under the Apache License, Version 2.0 (the "License") and you may not use these files except in compliance with the License. You may obtain a copy of the License at
6
6
  http://www.apache.org/licenses/LICENSE-2.0
7
7
  Unless required by applicable law or agreed to in writing, the Mojaloop files are distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
8
8
  Contributors
@@ -12,10 +12,10 @@
12
12
  should be listed with a '*' in the first column. People who have
13
13
  contributed from an organization can be listed under the organization
14
14
  that actually holds the copyright for their contributions (see the
15
- Gates Foundation organization for an example). Those individuals should have
15
+ Mojaloop Foundation organization for an example). Those individuals should have
16
16
  their names indented and be marked with a '-'. Email address can be added
17
17
  optionally within square brackets <email>.
18
- * Gates Foundation
18
+ * Mojaloop Foundation
19
19
 
20
20
  * Rajiv Mothilal <rajiv.mothilal@modusbox.com>
21
21
 
@@ -25,6 +25,7 @@
25
25
  'use strict'
26
26
 
27
27
  const Enum = require('@mojaloop/central-services-shared').Enum
28
+ const EventFrameworkUtil = require('@mojaloop/central-services-shared').Util.EventFramework
28
29
  const EventSdk = require('@mojaloop/event-sdk')
29
30
  const Metrics = require('@mojaloop/central-services-metrics')
30
31
  const LibUtil = require('../lib/util')
@@ -47,9 +48,22 @@ module.exports = {
47
48
  'Ingress: Get oracles',
48
49
  ['success']
49
50
  ).startTimer()
50
- const span = request.span
51
- const spanTags = LibUtil.getSpanTags(request, Enum.Events.Event.Type.ORACLE, Enum.Events.Event.Action.LOOKUP)
51
+ const { query, path, method, span } = request
52
+ const spanTags = LibUtil.getSpanTags(request, Enum.Events.Event.Type.ORACLE, Enum.Events.Event.Action.GET)
52
53
  span.setTags(spanTags)
54
+ const queryTags = EventFrameworkUtil.Tags.getQueryTags(
55
+ Enum.Tags.QueryTags.serviceName.accountLookupServiceAdmin,
56
+ Enum.Tags.QueryTags.auditType.oracleAdmin,
57
+ Enum.Tags.QueryTags.contentType.httpRequest,
58
+ Enum.Tags.QueryTags.operation.getOracle,
59
+ {
60
+ httpMethod: method,
61
+ httpPath: path,
62
+ httpQuery: query,
63
+ partyIdType: query.type
64
+ }
65
+ )
66
+ span.setTags(queryTags)
53
67
  await span.audit({
54
68
  headers: request.headers,
55
69
  query: request.query
@@ -77,9 +91,21 @@ module.exports = {
77
91
  'Ingress: Create oracles',
78
92
  ['success']
79
93
  ).startTimer()
80
- const span = request.span
94
+ const { payload, method, path, span } = request
81
95
  const spanTags = LibUtil.getSpanTags(request, Enum.Events.Event.Type.ORACLE, Enum.Events.Event.Action.POST)
82
96
  span.setTags(spanTags)
97
+ const queryTags = EventFrameworkUtil.Tags.getQueryTags(
98
+ Enum.Tags.QueryTags.serviceName.accountLookupServiceAdmin,
99
+ Enum.Tags.QueryTags.auditType.oracleAdmin,
100
+ Enum.Tags.QueryTags.contentType.httpRequest,
101
+ Enum.Tags.QueryTags.operation.createOracle,
102
+ {
103
+ httpMethod: method,
104
+ httpPath: path,
105
+ partyIdType: payload.oracleIdType
106
+ }
107
+ )
108
+ span.setTags(queryTags)
83
109
  await span.audit({
84
110
  headers: request.headers,
85
111
  payload: request.payload
@@ -1,8 +1,8 @@
1
1
  /*****
2
2
  License
3
3
  --------------
4
- Copyright © 2017 Bill & Melinda Gates Foundation
5
- The Mojaloop files are made available by the Bill & Melinda Gates Foundation under the Apache License, Version 2.0 (the "License") and you may not use these files except in compliance with the License. You may obtain a copy of the License at
4
+ Copyright © 2020-2025 Mojaloop Foundation
5
+ The Mojaloop files are made available by the 2020-2025 Mojaloop Foundation under the Apache License, Version 2.0 (the "License") and you may not use these files except in compliance with the License. You may obtain a copy of the License at
6
6
  http://www.apache.org/licenses/LICENSE-2.0
7
7
  Unless required by applicable law or agreed to in writing, the Mojaloop files are distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
8
8
  Contributors
@@ -12,11 +12,11 @@
12
12
  should be listed with a '*' in the first column. People who have
13
13
  contributed from an organization can be listed under the organization
14
14
  that actually holds the copyright for their contributions (see the
15
- Gates Foundation organization for an example). Those individuals should have
15
+ Mojaloop Foundation organization for an example). Those individuals should have
16
16
  their names indented and be marked with a '-'. Email address can be added
17
17
  optionally within square brackets <email>.
18
- * Gates Foundation
19
- * Name Surname <name.surname@gatesfoundation.com>
18
+ * Mojaloop Foundation
19
+ * Name Surname <name.surname@mojaloop.io>
20
20
 
21
21
  * Rajiv Mothilal <rajiv.mothilal@modusbox.com>
22
22
 
@@ -1,8 +1,8 @@
1
1
  /*****
2
2
  License
3
3
  --------------
4
- Copyright © 2017 Bill & Melinda Gates Foundation
5
- The Mojaloop files are made available by the Bill & Melinda Gates Foundation under the Apache License, Version 2.0 (the "License") and you may not use these files except in compliance with the License. You may obtain a copy of the License at
4
+ Copyright © 2020-2025 Mojaloop Foundation
5
+ The Mojaloop files are made available by the 2020-2025 Mojaloop Foundation under the Apache License, Version 2.0 (the "License") and you may not use these files except in compliance with the License. You may obtain a copy of the License at
6
6
  http://www.apache.org/licenses/LICENSE-2.0
7
7
  Unless required by applicable law or agreed to in writing, the Mojaloop files are distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
8
8
  Contributors
@@ -12,11 +12,11 @@
12
12
  should be listed with a '*' in the first column. People who have
13
13
  contributed from an organization can be listed under the organization
14
14
  that actually holds the copyright for their contributions (see the
15
- Gates Foundation organization for an example). Those individuals should have
15
+ Mojaloop Foundation organization for an example). Those individuals should have
16
16
  their names indented and be marked with a '-'. Email address can be added
17
17
  optionally within square brackets <email>.
18
- * Gates Foundation
19
- * Name Surname <name.surname@gatesfoundation.com>
18
+ * Mojaloop Foundation
19
+ * Name Surname <name.surname@mojaloop.io>
20
20
 
21
21
  * Rajiv Mothilal <rajiv.mothilal@modusbox.com>
22
22
 
@@ -1,8 +1,8 @@
1
1
  /*****
2
2
  License
3
3
  --------------
4
- Copyright © 2017 Bill & Melinda Gates Foundation
5
- The Mojaloop files are made available by the Bill & Melinda Gates Foundation under the Apache License, Version 2.0 (the "License") and you may not use these files except in compliance with the License. You may obtain a copy of the License at
4
+ Copyright © 2020-2025 Mojaloop Foundation
5
+ The Mojaloop files are made available by the 2020-2025 Mojaloop Foundation under the Apache License, Version 2.0 (the "License") and you may not use these files except in compliance with the License. You may obtain a copy of the License at
6
6
  http://www.apache.org/licenses/LICENSE-2.0
7
7
  Unless required by applicable law or agreed to in writing, the Mojaloop files are distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
8
8
  Contributors
@@ -12,11 +12,11 @@
12
12
  should be listed with a '*' in the first column. People who have
13
13
  contributed from an organization can be listed under the organization
14
14
  that actually holds the copyright for their contributions (see the
15
- Gates Foundation organization for an example). Those individuals should have
15
+ Mojaloop Foundation organization for an example). Those individuals should have
16
16
  their names indented and be marked with a '-'. Email address can be added
17
17
  optionally within square brackets <email>.
18
- * Gates Foundation
19
- - Name Surname <name.surname@gatesfoundation.com>
18
+ * Mojaloop Foundation
19
+ - Name Surname <name.surname@mojaloop.io>
20
20
 
21
21
  - Rajiv Mothilal <rajiv.mothilal@modusbox.com>
22
22
  - Juan Correa <juan.correa@modusbox.com>
@@ -26,6 +26,7 @@
26
26
  'use strict'
27
27
 
28
28
  const Enum = require('@mojaloop/central-services-shared').Enum
29
+ const EventFrameworkUtil = require('@mojaloop/central-services-shared').Util.EventFramework
29
30
  const ErrorHandler = require('@mojaloop/central-services-error-handling')
30
31
  const EventSdk = require('@mojaloop/event-sdk')
31
32
  const Metrics = require('@mojaloop/central-services-metrics')
@@ -49,9 +50,24 @@ module.exports = {
49
50
  'Ingress: Put participant error by Type and Id',
50
51
  ['success']
51
52
  ).startTimer()
52
- const span = request.span
53
+ const { method, path, params, span } = request
53
54
  const spanTags = LibUtil.getSpanTags(request, Enum.Events.Event.Type.PARTICIPANT, Enum.Events.Event.Action.PUT)
54
55
  span.setTags(spanTags)
56
+
57
+ const queryTags = EventFrameworkUtil.Tags.getQueryTags(
58
+ Enum.Tags.QueryTags.serviceName.accountLookupService,
59
+ Enum.Tags.QueryTags.auditType.partyOnboarding,
60
+ Enum.Tags.QueryTags.contentType.httpRequest,
61
+ Enum.Tags.QueryTags.operation.putParticipantsErrorByTypeAndID,
62
+ {
63
+ httpMethod: method,
64
+ httpPath: path,
65
+ partyIdType: params.Type,
66
+ partyIdentifier: params.ID
67
+ }
68
+ )
69
+ span.setTags(queryTags)
70
+
55
71
  const metadata = `${request.method} ${request.path}`
56
72
  try {
57
73
  await span.audit({
@@ -1,8 +1,8 @@
1
1
  /*****
2
2
  License
3
3
  --------------
4
- Copyright © 2017 Bill & Melinda Gates Foundation
5
- The Mojaloop files are made available by the Bill & Melinda Gates Foundation under the Apache License, Version 2.0 (the "License") and you may not use these files except in compliance with the License. You may obtain a copy of the License at
4
+ Copyright © 2020-2025 Mojaloop Foundation
5
+ The Mojaloop files are made available by the 2020-2025 Mojaloop Foundation under the Apache License, Version 2.0 (the "License") and you may not use these files except in compliance with the License. You may obtain a copy of the License at
6
6
  http://www.apache.org/licenses/LICENSE-2.0
7
7
  Unless required by applicable law or agreed to in writing, the Mojaloop files are distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
8
8
  Contributors
@@ -12,11 +12,11 @@
12
12
  should be listed with a '*' in the first column. People who have
13
13
  contributed from an organization can be listed under the organization
14
14
  that actually holds the copyright for their contributions (see the
15
- Gates Foundation organization for an example). Those individuals should have
15
+ Mojaloop Foundation organization for an example). Those individuals should have
16
16
  their names indented and be marked with a '-'. Email address can be added
17
17
  optionally within square brackets <email>.
18
- * Gates Foundation
19
- * Name Surname <name.surname@gatesfoundation.com>
18
+ * Mojaloop Foundation
19
+ * Name Surname <name.surname@mojaloop.io>
20
20
 
21
21
  * Rajiv Mothilal <rajiv.mothilal@modusbox.com>
22
22
  * Steven Oderayi <steven.oderayi@modusbox.com>
@@ -1,8 +1,8 @@
1
1
  /*****
2
2
  License
3
3
  --------------
4
- Copyright © 2017 Bill & Melinda Gates Foundation
5
- The Mojaloop files are made available by the Bill & Melinda Gates Foundation under the Apache License, Version 2.0 (the "License") and you may not use these files except in compliance with the License. You may obtain a copy of the License at
4
+ Copyright © 2020-2025 Mojaloop Foundation
5
+ The Mojaloop files are made available by the 2020-2025 Mojaloop Foundation under the Apache License, Version 2.0 (the "License") and you may not use these files except in compliance with the License. You may obtain a copy of the License at
6
6
  http://www.apache.org/licenses/LICENSE-2.0
7
7
  Unless required by applicable law or agreed to in writing, the Mojaloop files are distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
8
8
  Contributors
@@ -12,11 +12,11 @@
12
12
  should be listed with a '*' in the first column. People who have
13
13
  contributed from an organization can be listed under the organization
14
14
  that actually holds the copyright for their contributions (see the
15
- Gates Foundation organization for an example). Those individuals should have
15
+ Mojaloop Foundation organization for an example). Those individuals should have
16
16
  their names indented and be marked with a '-'. Email address can be added
17
17
  optionally within square brackets <email>.
18
- * Gates Foundation
19
- * Name Surname <name.surname@gatesfoundation.com>
18
+ * Mojaloop Foundation
19
+ * Name Surname <name.surname@mojaloop.io>
20
20
 
21
21
  * Rajiv Mothilal <rajiv.mothilal@modusbox.com>
22
22
  * Steven Oderayi <steven.oerayi@modusbox.com>
@@ -26,7 +26,9 @@
26
26
  'use strict'
27
27
 
28
28
  const Enum = require('@mojaloop/central-services-shared').Enum
29
+ const EventFrameworkUtil = require('@mojaloop/central-services-shared').Util.EventFramework
29
30
  const LibUtil = require('../../../../lib/util')
31
+ const EventSdk = require('@mojaloop/event-sdk')
30
32
  const participants = require('../../../../domain/participants')
31
33
  const Metrics = require('@mojaloop/central-services-metrics')
32
34
 
@@ -47,6 +49,29 @@ module.exports = {
47
49
  'Ingress: Get participant by Type, ID and SubId',
48
50
  ['success']
49
51
  ).startTimer()
52
+
53
+ const { headers, payload, method, path, params, span } = request
54
+ const spanTags = LibUtil.getSpanTags(request, Enum.Events.Event.Type.PARTICIPANT, Enum.Events.Event.Action.GET)
55
+ span.setTags(spanTags)
56
+ const queryTags = EventFrameworkUtil.Tags.getQueryTags(
57
+ Enum.Tags.QueryTags.serviceName.accountLookupService,
58
+ Enum.Tags.QueryTags.auditType.partyOnboarding,
59
+ Enum.Tags.QueryTags.contentType.httpRequest,
60
+ Enum.Tags.QueryTags.operation.getParticipantsByTypeIdAndSubID,
61
+ {
62
+ httpMethod: method,
63
+ httpPath: path,
64
+ partyIdType: params.Type,
65
+ partyIdentifier: params.ID,
66
+ partySubIdOrType: params.SubId
67
+ }
68
+ )
69
+ span.setTags(queryTags)
70
+ await span.audit({
71
+ headers,
72
+ payload
73
+ }, EventSdk.AuditEventAction.start)
74
+
50
75
  participants.getParticipantsByTypeAndID(request.headers, request.params, request.method, request.query, request.span, request.server.app.cache).catch(err => {
51
76
  request.server.log(['error'], `ERROR - getParticipantsByTypeAndID: ${LibUtil.getStackOrInspect(err)}`)
52
77
  })
@@ -66,6 +91,29 @@ module.exports = {
66
91
  'Ingress: Put participant by Type, ID and SubId',
67
92
  ['success']
68
93
  ).startTimer()
94
+
95
+ const { headers, payload, method, path, params, span } = request
96
+ const spanTags = LibUtil.getSpanTags(request, Enum.Events.Event.Type.PARTICIPANT, Enum.Events.Event.Action.PUT)
97
+ span.setTags(spanTags)
98
+ const queryTags = EventFrameworkUtil.Tags.getQueryTags(
99
+ Enum.Tags.QueryTags.serviceName.accountLookupService,
100
+ Enum.Tags.QueryTags.auditType.partyOnboarding,
101
+ Enum.Tags.QueryTags.contentType.httpRequest,
102
+ Enum.Tags.QueryTags.operation.putParticipantsByTypeIDAndSubID,
103
+ {
104
+ httpMethod: method,
105
+ httpPath: path,
106
+ partyIdType: params.Type,
107
+ partyIdentifier: params.ID,
108
+ partySubIdOrType: params.SubId
109
+ }
110
+ )
111
+ span.setTags(queryTags)
112
+ await span.audit({
113
+ headers,
114
+ payload
115
+ }, EventSdk.AuditEventAction.start)
116
+
69
117
  participants.putParticipantsByTypeAndID(request.headers, request.params, request.method, request.payload, request.server.app.cache).catch(err => {
70
118
  request.server.log(['error'], `ERROR - putParticipantsByTypeAndID: ${LibUtil.getStackOrInspect(err)}`)
71
119
  })
@@ -85,6 +133,29 @@ module.exports = {
85
133
  'Ingress: Post participant by Type, ID and SubId',
86
134
  ['success']
87
135
  ).startTimer()
136
+
137
+ const { headers, payload, method, path, params, span } = request
138
+ const spanTags = LibUtil.getSpanTags(request, Enum.Events.Event.Type.PARTICIPANT, Enum.Events.Event.Action.POST)
139
+ span.setTags(spanTags)
140
+ const queryTags = EventFrameworkUtil.Tags.getQueryTags(
141
+ Enum.Tags.QueryTags.serviceName.accountLookupService,
142
+ Enum.Tags.QueryTags.auditType.partyOnboarding,
143
+ Enum.Tags.QueryTags.contentType.httpRequest,
144
+ Enum.Tags.QueryTags.operation.postParticipantsByTypeIDAndSubID,
145
+ {
146
+ httpMethod: method,
147
+ httpPath: path,
148
+ partyIdType: params.Type,
149
+ partyIdentifier: params.ID,
150
+ partySubIdOrType: params.SubId
151
+ }
152
+ )
153
+ span.setTags(queryTags)
154
+ await span.audit({
155
+ headers,
156
+ payload
157
+ }, EventSdk.AuditEventAction.start)
158
+
88
159
  participants.postParticipants(request.headers, request.method, request.params, request.payload, request.span, request.server.app.cache).catch(err => {
89
160
  request.server.log(['error'], `ERROR - postParticipants: ${LibUtil.getStackOrInspect(err)}`)
90
161
  })
@@ -104,6 +175,29 @@ module.exports = {
104
175
  'Ingress: Delete participant by Type, ID and SubId',
105
176
  ['success']
106
177
  ).startTimer()
178
+
179
+ const { headers, payload, method, path, params, span } = request
180
+ const spanTags = LibUtil.getSpanTags(request, Enum.Events.Event.Type.PARTICIPANT, Enum.Events.Event.Action.DELETE)
181
+ span.setTags(spanTags)
182
+ const queryTags = EventFrameworkUtil.Tags.getQueryTags(
183
+ Enum.Tags.QueryTags.serviceName.accountLookupService,
184
+ Enum.Tags.QueryTags.auditType.partyOnboarding,
185
+ Enum.Tags.QueryTags.contentType.httpRequest,
186
+ Enum.Tags.QueryTags.operation.deleteParticipantsByTypeIDAndSubID,
187
+ {
188
+ httpMethod: method,
189
+ httpPath: path,
190
+ partyIdType: params.Type,
191
+ partyIdentifier: params.ID,
192
+ partySubIdOrType: params.SubId
193
+ }
194
+ )
195
+ span.setTags(queryTags)
196
+ await span.audit({
197
+ headers,
198
+ payload
199
+ }, EventSdk.AuditEventAction.start)
200
+
107
201
  participants.deleteParticipants(request.headers, request.params, request.method, request.query, request.server.app.cache).catch(err => {
108
202
  request.server.log(['error'], `ERROR - deleteParticipants: ${LibUtil.getStackOrInspect(err)}`)
109
203
  })
@@ -1,8 +1,8 @@
1
1
  /*****
2
2
  License
3
3
  --------------
4
- Copyright © 2017 Bill & Melinda Gates Foundation
5
- The Mojaloop files are made available by the Bill & Melinda Gates Foundation under the Apache License, Version 2.0 (the "License") and you may not use these files except in compliance with the License. You may obtain a copy of the License at
4
+ Copyright © 2020-2025 Mojaloop Foundation
5
+ The Mojaloop files are made available by the 2020-2025 Mojaloop Foundation under the Apache License, Version 2.0 (the "License") and you may not use these files except in compliance with the License. You may obtain a copy of the License at
6
6
  http://www.apache.org/licenses/LICENSE-2.0
7
7
  Unless required by applicable law or agreed to in writing, the Mojaloop files are distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
8
8
  Contributors
@@ -12,11 +12,11 @@
12
12
  should be listed with a '*' in the first column. People who have
13
13
  contributed from an organization can be listed under the organization
14
14
  that actually holds the copyright for their contributions (see the
15
- Gates Foundation organization for an example). Those individuals should have
15
+ Mojaloop Foundation organization for an example). Those individuals should have
16
16
  their names indented and be marked with a '-'. Email address can be added
17
17
  optionally within square brackets <email>.
18
- * Gates Foundation
19
- * Name Surname <name.surname@gatesfoundation.com>
18
+ * Mojaloop Foundation
19
+ * Name Surname <name.surname@mojaloop.io>
20
20
 
21
21
  * Rajiv Mothilal <rajiv.mothilal@modusbox.com>
22
22
  * Juan Correa <juan.correa@modusbox.com>
@@ -26,6 +26,7 @@
26
26
  'use strict'
27
27
 
28
28
  const Enum = require('@mojaloop/central-services-shared').Enum
29
+ const EventFrameworkUtil = require('@mojaloop/central-services-shared').Util.EventFramework
29
30
  const EventSdk = require('@mojaloop/event-sdk')
30
31
  const Metrics = require('@mojaloop/central-services-metrics')
31
32
  const LibUtil = require('../../../lib/util')
@@ -48,13 +49,28 @@ module.exports = {
48
49
  'Ingress: Get participant by Type and Id',
49
50
  ['success']
50
51
  ).startTimer()
51
- const span = request.span
52
- const spanTags = LibUtil.getSpanTags(request, Enum.Events.Event.Type.PARTICIPANT, Enum.Events.Event.Action.LOOKUP)
52
+
53
+ const { headers, payload, method, path, params, span } = request
54
+ const spanTags = LibUtil.getSpanTags(request, Enum.Events.Event.Type.PARTICIPANT, Enum.Events.Event.Action.GET)
53
55
  span.setTags(spanTags)
56
+ const queryTags = EventFrameworkUtil.Tags.getQueryTags(
57
+ Enum.Tags.QueryTags.serviceName.accountLookupService,
58
+ Enum.Tags.QueryTags.auditType.partyOnboarding,
59
+ Enum.Tags.QueryTags.contentType.httpRequest,
60
+ Enum.Tags.QueryTags.operation.getParticipantsByTypeAndID,
61
+ {
62
+ httpMethod: method,
63
+ httpPath: path,
64
+ partyIdType: params.Type,
65
+ partyIdentifier: params.ID
66
+ }
67
+ )
68
+ span.setTags(queryTags)
54
69
  await span.audit({
55
- headers: request.headers,
56
- payload: request.payload
70
+ headers,
71
+ payload
57
72
  }, EventSdk.AuditEventAction.start)
73
+
58
74
  const metadata = `${request.method} ${request.path}`
59
75
  participants.getParticipantsByTypeAndID(request.headers, request.params, request.method, request.query, span, request.server.app.cache).catch(err => {
60
76
  request.server.log(['error'], `ERROR - getParticipantsByTypeAndID:${metadata}: ${LibUtil.getStackOrInspect(err)}`)
@@ -77,6 +93,28 @@ module.exports = {
77
93
  ['success']
78
94
  ).startTimer()
79
95
  const metadata = `${request.method} ${request.path}`
96
+
97
+ const { headers, payload, method, path, params, span } = request
98
+ const spanTags = LibUtil.getSpanTags(request, Enum.Events.Event.Type.PARTICIPANT, Enum.Events.Event.Action.PUT)
99
+ span.setTags(spanTags)
100
+ const queryTags = EventFrameworkUtil.Tags.getQueryTags(
101
+ Enum.Tags.QueryTags.serviceName.accountLookupService,
102
+ Enum.Tags.QueryTags.auditType.partyOnboarding,
103
+ Enum.Tags.QueryTags.contentType.httpRequest,
104
+ Enum.Tags.QueryTags.operation.putParticipantsByTypeAndID,
105
+ {
106
+ httpMethod: method,
107
+ httpPath: path,
108
+ partyIdType: params.Type,
109
+ partyIdentifier: params.ID
110
+ }
111
+ )
112
+ span.setTags(queryTags)
113
+ await span.audit({
114
+ headers,
115
+ payload
116
+ }, EventSdk.AuditEventAction.start)
117
+
80
118
  participants.putParticipantsByTypeAndID(request.headers, request.params, request.method, request.payload, request.server.app.cache).catch(err => {
81
119
  request.server.log(['error'], `ERROR - putParticipantsByTypeAndID:${metadata}: ${LibUtil.getStackOrInspect(err)}`)
82
120
  })
@@ -96,9 +134,22 @@ module.exports = {
96
134
  'Ingress: Post participant by Type and Id',
97
135
  ['success']
98
136
  ).startTimer()
99
- const span = request.span
137
+ const { method, path, params, span } = request
100
138
  const spanTags = LibUtil.getSpanTags(request, Enum.Events.Event.Type.PARTICIPANT, Enum.Events.Event.Action.POST)
101
139
  span.setTags(spanTags)
140
+ const queryTags = EventFrameworkUtil.Tags.getQueryTags(
141
+ Enum.Tags.QueryTags.serviceName.accountLookupService,
142
+ Enum.Tags.QueryTags.auditType.partyOnboarding,
143
+ Enum.Tags.QueryTags.contentType.httpRequest,
144
+ Enum.Tags.QueryTags.operation.postParticipantsByTypeAndID,
145
+ {
146
+ httpMethod: method,
147
+ httpPath: path,
148
+ partyIdType: params.Type,
149
+ partyIdentifier: params.ID
150
+ }
151
+ )
152
+ span.setTags(queryTags)
102
153
  await span.audit({
103
154
  headers: request.headers,
104
155
  payload: request.payload
@@ -123,6 +174,28 @@ module.exports = {
123
174
  'Ingress: Delete participant by Type and Id',
124
175
  ['success']
125
176
  ).startTimer()
177
+
178
+ const { headers, payload, method, path, params, span } = request
179
+ const spanTags = LibUtil.getSpanTags(request, Enum.Events.Event.Type.PARTICIPANT, Enum.Events.Event.Action.DELETE)
180
+ span.setTags(spanTags)
181
+ const queryTags = EventFrameworkUtil.Tags.getQueryTags(
182
+ Enum.Tags.QueryTags.serviceName.accountLookupService,
183
+ Enum.Tags.QueryTags.auditType.partyOnboarding,
184
+ Enum.Tags.QueryTags.contentType.httpRequest,
185
+ Enum.Tags.QueryTags.operation.deleteParticipantsByTypeAndID,
186
+ {
187
+ httpMethod: method,
188
+ httpPath: path,
189
+ partyIdType: params.Type,
190
+ partyIdentifier: params.ID
191
+ }
192
+ )
193
+ span.setTags(queryTags)
194
+ await span.audit({
195
+ headers,
196
+ payload
197
+ }, EventSdk.AuditEventAction.start)
198
+
126
199
  const metadata = `${request.method} ${request.path}`
127
200
  participants.deleteParticipants(request.headers, request.params, request.method, request.query, request.server.app.cache).catch(err => {
128
201
  request.server.log(['error'], `ERROR - deleteParticipants:${metadata}: ${LibUtil.getStackOrInspect(err)}`)
@@ -1,8 +1,8 @@
1
1
  /*****
2
2
  License
3
3
  --------------
4
- Copyright © 2017 Bill & Melinda Gates Foundation
5
- The Mojaloop files are made available by the Bill & Melinda Gates Foundation under the Apache License, Version 2.0 (the "License") and you may not use these files except in compliance with the License. You may obtain a copy of the License at
4
+ Copyright © 2020-2025 Mojaloop Foundation
5
+ The Mojaloop files are made available by the 2020-2025 Mojaloop Foundation under the Apache License, Version 2.0 (the "License") and you may not use these files except in compliance with the License. You may obtain a copy of the License at
6
6
  http://www.apache.org/licenses/LICENSE-2.0
7
7
  Unless required by applicable law or agreed to in writing, the Mojaloop files are distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
8
8
  Contributors
@@ -12,11 +12,11 @@
12
12
  should be listed with a '*' in the first column. People who have
13
13
  contributed from an organization can be listed under the organization
14
14
  that actually holds the copyright for their contributions (see the
15
- Gates Foundation organization for an example). Those individuals should have
15
+ Mojaloop Foundation organization for an example). Those individuals should have
16
16
  their names indented and be marked with a '-'. Email address can be added
17
17
  optionally within square brackets <email>.
18
- * Gates Foundation
19
- - Name Surname <name.surname@gatesfoundation.com>
18
+ * Mojaloop Foundation
19
+ - Name Surname <name.surname@mojaloop.io>
20
20
 
21
21
  - Rajiv Mothilal <rajiv.mothilal@modusbox.com>
22
22
 
@@ -25,6 +25,7 @@
25
25
  'use strict'
26
26
 
27
27
  const Enum = require('@mojaloop/central-services-shared').Enum
28
+ const EventFrameworkUtil = require('@mojaloop/central-services-shared').Util.EventFramework
28
29
  const EventSdk = require('@mojaloop/event-sdk')
29
30
  const LibUtil = require('../lib/util')
30
31
  const participants = require('../domain/participants')
@@ -47,9 +48,21 @@ module.exports = {
47
48
  'Ingress: Post participants batch',
48
49
  ['success']
49
50
  ).startTimer()
50
- const span = request.span
51
+ const { payload, method, span } = request
51
52
  const spanTags = LibUtil.getSpanTags(request, Enum.Events.Event.Type.PARTICIPANT, Enum.Events.Event.Action.POST)
52
53
  span.setTags(spanTags)
54
+ const queryTags = EventFrameworkUtil.Tags.getQueryTags(
55
+ Enum.Tags.QueryTags.serviceName.accountLookupService,
56
+ Enum.Tags.QueryTags.auditType.partyOnboarding,
57
+ Enum.Tags.QueryTags.contentType.httpRequest,
58
+ Enum.Tags.QueryTags.operation.postParticipantsBatch,
59
+ {
60
+ httpMethod: method,
61
+ httpPath: request.path,
62
+ requestId: payload.requestId
63
+ }
64
+ )
65
+ span.setTags(queryTags)
53
66
  await span.audit({
54
67
  headers: request.headers,
55
68
  payload: request.payload
@@ -1,8 +1,8 @@
1
1
  /*****
2
2
  License
3
3
  --------------
4
- Copyright © 2017 Bill & Melinda Gates Foundation
5
- The Mojaloop files are made available by the Bill & Melinda Gates Foundation under the Apache License, Version 2.0 (the "License") and you may not use these files except in compliance with the License. You may obtain a copy of the License at
4
+ Copyright © 2020-2025 Mojaloop Foundation
5
+ The Mojaloop files are made available by the 2020-2025 Mojaloop Foundation under the Apache License, Version 2.0 (the "License") and you may not use these files except in compliance with the License. You may obtain a copy of the License at
6
6
  http://www.apache.org/licenses/LICENSE-2.0
7
7
  Unless required by applicable law or agreed to in writing, the Mojaloop files are distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
8
8
  Contributors
@@ -12,11 +12,11 @@
12
12
  should be listed with a '*' in the first column. People who have
13
13
  contributed from an organization can be listed under the organization
14
14
  that actually holds the copyright for their contributions (see the
15
- Gates Foundation organization for an example). Those individuals should have
15
+ Mojaloop Foundation organization for an example). Those individuals should have
16
16
  their names indented and be marked with a '-'. Email address can be added
17
17
  optionally within square brackets <email>.
18
- * Gates Foundation
19
- * Name Surname <name.surname@gatesfoundation.com>
18
+ * Mojaloop Foundation
19
+ * Name Surname <name.surname@mojaloop.io>
20
20
 
21
21
  * Rajiv Mothilal <rajiv.mothilal@modusbox.com>
22
22
 
@@ -25,6 +25,7 @@
25
25
  'use strict'
26
26
 
27
27
  const Enum = require('@mojaloop/central-services-shared').Enum
28
+ const EventFrameworkUtil = require('@mojaloop/central-services-shared').Util.EventFramework
28
29
  const EventSdk = require('@mojaloop/event-sdk')
29
30
  const LibUtil = require('../../../../lib/util')
30
31
  const parties = require('../../../../domain/parties')
@@ -47,11 +48,24 @@ module.exports = {
47
48
  'Ingress - Put parties error by Type and Id',
48
49
  ['success']
49
50
  ).startTimer()
50
- const { headers, payload, params, dataUri, span } = request
51
+ const { headers, payload, method, path, params, dataUri, span } = request
51
52
  const { cache, proxyCache } = request.server.app
52
53
 
53
54
  const spanTags = LibUtil.getSpanTags(request, Enum.Events.Event.Type.PARTY, Enum.Events.Event.Action.PUT)
54
55
  span.setTags(spanTags)
56
+ const queryTags = EventFrameworkUtil.Tags.getQueryTags(
57
+ Enum.Tags.QueryTags.serviceName.accountLookupService,
58
+ Enum.Tags.QueryTags.auditType.transactionFlow,
59
+ Enum.Tags.QueryTags.contentType.httpRequest,
60
+ Enum.Tags.QueryTags.operation.putPartiesErrorByTypeAndID,
61
+ {
62
+ httpMethod: method,
63
+ httpPath: path,
64
+ partyIdType: params.Type,
65
+ partyIdentifier: params.ID
66
+ }
67
+ )
68
+ span.setTags(queryTags)
55
69
  await span.audit({
56
70
  headers,
57
71
  payload