Skip to content
This repository was archived by the owner on Mar 13, 2025. It is now read-only.
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 51d0a68

Browse files
author
sachin-maheshwari
authoredSep 6, 2021
Merge pull request #38 from topcoder-platform/feature/shapeup-cqrs-update2
DEV: shapeup#4 CQRS Standards Update for all objects
2 parents 45f63a5 + 5185e41 commit 51d0a68

File tree

20 files changed

+34
-4445
lines changed

20 files changed

+34
-4445
lines changed
 

‎.circleci/config.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ workflows:
7070
branches:
7171
only:
7272
- develop
73-
- feature/shapeup-cqrs-update
73+
- feature/shapeup-cqrs-update2
7474

7575
# Production builds are exectuted only on tagged commits to the
7676
# master branch.

‎README.md

Lines changed: 0 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -20,70 +20,22 @@ The following parameters can be set in config files or in env variables:
2020
if not provided, then SSL connection is not used, direct insecure connection is used;
2121
if provided, it can be either path to private key file or private key content
2222
- KAFKA_GROUP_ID: the Kafka group id, default value is 'ubahn-processor-es'
23-
- UBAHN_CREATE_TOPIC: the create ubahn entity Kafka message topic, default value is 'u-bahn.action.create'
24-
- UBAHN_UPDATE_TOPIC: the update ubahn entity Kafka message topic, default value is 'u-bahn.action.update'
25-
- UBAHN_DELETE_TOPIC: the delete ubahn entity Kafka message topic, default value is 'u-bahn.action.delete'
26-
- UBAHN_AGGREGATE_TOPIC: the ubahn entity aggregate topic, that contains create, update and delete topics. Default value is 'u-bahn.action.aggregate'
2723
- GROUPS_MEMBER_ADD_TOPIC: the add groups member Kafka message topic, default value is 'groups.notification.member.add'
2824
- GROUPS_MEMBER_DELETE_TOPIC: the delete groups member Kafka message topic, default value is 'groups.notification.member.delete'
2925
- GROUPS_MEMBERSHIP_TYPE: the groups membership type that should be processed, default value is 'user'
3026
- ES_HOST: Elasticsearch host, default value is 'localhost:9200'
3127
- ES.AWS_REGION: The Amazon region to use when using AWS Elasticsearch service, default value is 'us-east-1'
32-
- ES.ACHIEVEMENT_PROVIDER_INDEX: Elasticsearch index name for achievement provider, default value is 'achievement_provider'
33-
- ES.ACHIEVEMENT_PROVIDER_TYPE: Elasticsearch index type for achievement provider, default value is '_doc'
34-
- ES.ATTRIBUTE_INDEX: Elasticsearch index name for attribute, default value is 'attribute'
35-
- ES.ATTRIBUTE_TYPE: Elasticsearch index type for attribute, default value is '_doc'
36-
- ES.ATTRIBUTE_GROUP_INDEX: Elasticsearch index name for attribute group, default value is 'attribute_group'
37-
- ES.ATTRIBUTE_GROUP_TYPE: Elasticsearch index type for attribute group, default value is '_doc'
38-
- ES.ORGANIZATION_INDEX: Elasticsearch index name for organization, default value is 'organization'
39-
- ES.ORGANIZATION_TYPE: Elasticsearch index type for organization, default value is '_doc'
40-
- ES.ROLE_INDEX: Elasticsearch index name for role, default value is 'role'
41-
- ES.ROLE_TYPE: Elasticsearch index type for role, default value is '_doc'
42-
- ES.SKILL_INDEX: Elasticsearch index name for skill, default value is 'skill'
43-
- ES.SKILL_TYPE: Elasticsearch index type for skill, default value is '_doc'
44-
- ES.SKILL_PROVIDER_INDEX: Elasticsearch index name for skill provider, default value is 'skill_provider'
45-
- ES.SKILL_PROVIDER_TYPE: Elasticsearch index type for skill provider, default value is '_doc'
46-
- ES.USER_INDEX: Elasticsearch index name for user, default value is 'user'
47-
- ES.USER_TYPE: Elasticsearch index type for user, default value is '_doc'
48-
- ES.USER_ACHIEVEMENT_PROPERTY_NAME: the user property name of achievement, default value is 'achievements',
49-
- ES.USER_EXTERNALPROFILE_PROPERTY_NAME: the user property name of externalProfile, default value is 'externalProfiles',
50-
- ES.USER_ATTRIBUTE_PROPERTY_NAME: the user property name of attribute, default value is 'attributes',
51-
- ES.USER_ROLE_PROPERTY_NAME: the user property name of role, default value is 'roles',
52-
- ES.USER_SKILL_PROPERTY_NAME: the user property name of skill, default value is 'skills'
53-
- ES.ORGANIZATION_SKILLPROVIDER_PROPERTY_NAME: the org property name of org skill providers, default value is 'skillProviders'
5428
- ES.USER_GROUP_PROPERTY_NAME: the user property name of group, default value is 'groups'
55-
- ATTRIBUTE_GROUP_PIPELINE_ID: The pipeline id for enrichment with attribute group. Default is `attributegroup-pipeline`
56-
- SKILL_PROVIDER_PIPELINE_ID: The pipeline id for enrichment with skill provider. Default is `skillprovider-pipeline`
5729
- USER_PIPELINE_ID: The pipeline id for enrichment of user details. Default is `user-pipeline`
58-
- ATTRIBUTE_GROUP_ENRICH_POLICYNAME: The enrich policy for attribute group. Default is `attributegroup-policy`
59-
- SKILL_PROVIDER_ENRICH_POLICYNAME: The enrich policy for skill provider. Default is `skillprovider-policy`
60-
- ROLE_ENRICH_POLICYNAME: The enrich policy for role. Default is `role-policy`
61-
- ACHIEVEMENT_PROVIDER_ENRICH_POLICYNAME: The enrich policy for achievement provider. Default is `achievementprovider-policy`
62-
- SKILL_ENRICH_POLICYNAME: The enrich policy for skill. Default is `skill-policy`
63-
- ATTRIBUTE_ENRICH_POLICYNAME: The enrich policy for skill. Default is `attribute-policy`
6430
- ELASTICCLOUD_ID: The elastic cloud id, if your elasticsearch instance is hosted on elastic cloud. DO NOT provide a value for ES_HOST if you are using this
6531
- ELASTICCLOUD_USERNAME: The elastic cloud username for basic authentication. Provide this only if your elasticsearch instance is hosted on elastic cloud
6632
- ELASTICCLOUD_PASSWORD: The elastic cloud password for basic authentication. Provide this only if your elasticsearch instance is hosted on elastic cloud
67-
- AUTH0_URL: The auth0 url, Default is 'https://topcoder-dev.auth0.com/oauth/token'
68-
- AUTH0_AUDIENCE: The auth0 audience for accessing ubahn api(s), Default is 'https://m2m.topcoder-dev.com/'
69-
- AUTH0_CLIENT_ID: The auth0 client id
70-
- AUTH0_CLIENT_SECRET: The auth0 client secret
71-
- AUTH0_PROXY_SERVER_URL: The auth0 proxy server url
72-
- TOKEN_CACHE_TIME: The token cache time
73-
- TOPCODER_GROUP_API: The topcoder groups api, Default is 'https://api.topcoder-dev.com/v5/groups'
7433

7534
There is a `/health` endpoint that checks for the health of the app. This sets up an expressjs server and listens on the environment variable `PORT`. It's not part of the configuration file and needs to be passed as an environment variable
7635

7736
Configuration for the tests is at `config/test.js`, only add such new configurations different from `config/default.js`
7837

7938
- WAIT_TIME: wait time used in test, default is 1500 or 1.5 second
80-
- ES.ACHIEVEMENT_PROVIDER_INDEX: Elasticsearch index name for achievement provider in testing environment
81-
- ES.ATTRIBUTE_INDEX: Elasticsearch index name for attribute in testing environment
82-
- ES.ATTRIBUTE_GROUP_INDEX: Elasticsearch index name for attribute group in testing environment
83-
- ES.ORGANIZATION_INDEX: Elasticsearch index name for organization in testing environment
84-
- ES.ROLE_INDEX: Elasticsearch index name for role in testing environment
85-
- ES.SKILL_INDEX: Elasticsearch index name for skill in testing environment
86-
- ES.SKILL_PROVIDER_INDEX: Elasticsearch index name for skill provider in testing environment
8739
- ES.USER_INDEX: Elasticsearch index name for user in testing environment
8840

8941
## Local Kafka and ElasticSearch setup
@@ -150,14 +102,3 @@ To run the UBahn ES Processor using docker, follow the below steps
150102
```
151103

152104
5. When you are running the application for the first time, It will take some time initially to download the image and install the dependencies
153-
154-
## Unit Tests and E2E Tests
155-
156-
- Run `npm run test` to execute unit tests.
157-
- Run `npm run test:cov` to execute unit tests and generate coverage report.
158-
- RUN `npm run e2e` to execute e2e tests.
159-
- RUN `npm run e2e:cov` to execute e2e tests and generate coverage report.
160-
161-
## Verification
162-
163-
see [VERIFICATION.md](VERIFICATION.md)

‎VERIFICATION.md

Lines changed: 0 additions & 256 deletions
This file was deleted.

‎config/default.js

Lines changed: 0 additions & 79 deletions
Original file line numberDiff line numberDiff line change
@@ -14,19 +14,6 @@ module.exports = {
1414
// Kafka group id
1515
KAFKA_GROUP_ID: process.env.KAFKA_GROUP_ID || 'ubahn-processor-es',
1616

17-
TOPCODER_GROUP_API: process.env.TOPCODER_GROUP_API || 'https://api.topcoder-dev.com/v5/groups',
18-
19-
AUTH0_URL: process.env.AUTH0_URL || 'https://topcoder-dev.auth0.com/oauth/token', // Auth0 credentials
20-
AUTH0_AUDIENCE: process.env.AUTH0_AUDIENCE || 'https://m2m.topcoder-dev.com/',
21-
TOKEN_CACHE_TIME: process.env.TOKEN_CACHE_TIME,
22-
AUTH0_CLIENT_ID: process.env.AUTH0_CLIENT_ID,
23-
AUTH0_CLIENT_SECRET: process.env.AUTH0_CLIENT_SECRET,
24-
AUTH0_PROXY_SERVER_URL: process.env.AUTH0_PROXY_SERVER_URL,
25-
26-
UBAHN_CREATE_TOPIC: process.env.UBAHN_CREATE_TOPIC || 'u-bahn.action.create',
27-
UBAHN_UPDATE_TOPIC: process.env.UBAHN_UPDATE_TOPIC || 'u-bahn.action.update',
28-
UBAHN_DELETE_TOPIC: process.env.UBAHN_DELETE_TOPIC || 'u-bahn.action.delete',
29-
UBAHN_AGGREGATE_TOPIC: process.env.UBAHN_AGGREGATE_TOPIC || 'u-bahn.action.aggregate',
3017
GROUPS_MEMBER_ADD_TOPIC: process.env.GROUPS_MEMBER_ADD_TOPIC || 'groups.notification.member.add',
3118
GROUPS_MEMBER_DELETE_TOPIC: process.env.GROUPS_MEMBER_DELETE_TOPIC || 'groups.notification.member.delete',
3219
GROUPS_MEMBERSHIP_TYPE: process.env.GROUPS_MEMBERSHIP_TYPE || 'user',
@@ -41,78 +28,12 @@ module.exports = {
4128
},
4229

4330
AWS_REGION: process.env.AWS_REGION || 'us-east-1', // AWS Region to be used if we use AWS ES
44-
ACHIEVEMENT_PROVIDER_INDEX: process.env.ACHIEVEMENT_PROVIDER_INDEX || 'achievement_provider',
45-
ACHIEVEMENT_PROVIDER_TYPE: process.env.ACHIEVEMENT_PROVIDER_TYPE || '_doc',
46-
ATTRIBUTE_INDEX: process.env.ATTRIBUTE_INDEX || 'attribute',
47-
ATTRIBUTE_TYPE: process.env.ATTRIBUTE_TYPE || '_doc',
48-
ATTRIBUTE_GROUP_INDEX: process.env.ATTRIBUTE_GROUP_INDEX || 'attribute_group',
49-
ATTRIBUTE_GROUP_TYPE: process.env.ATTRIBUTE_GROUP_TYPE || '_doc',
50-
ORGANIZATION_INDEX: process.env.ORGANIZATION_INDEX || 'organization',
51-
ORGANIZATION_TYPE: process.env.ORGANIZATION_TYPE || '_doc',
52-
ROLE_INDEX: process.env.ROLE_INDEX || 'role',
53-
ROLE_TYPE: process.env.ROLE_TYPE || '_doc',
54-
SKILL_INDEX: process.env.SKILL_INDEX || 'skill',
55-
SKILL_TYPE: process.env.SKILL_TYPE || '_doc',
56-
SKILL_PROVIDER_INDEX: process.env.SKILL_PROVIDER_INDEX || 'skill_provider',
57-
SKILL_PROVIDER_TYPE: process.env.SKILL_PROVIDER_TYPE || '_doc',
5831
USER_INDEX: process.env.USER_INDEX || 'user',
5932
USER_TYPE: process.env.USER_TYPE || '_doc',
6033

61-
USER_ACHIEVEMENT_PROPERTY_NAME: process.env.USER_ACHIEVEMENT_PROPERTY_NAME || 'achievements',
62-
USER_EXTERNALPROFILE_PROPERTY_NAME: process.env.USER_EXTERNALPROFILE_PROPERTY_NAME || 'externalProfiles',
63-
USER_ATTRIBUTE_PROPERTY_NAME: process.env.USER_ATTRIBUTE_PROPERTY_NAME || 'attributes',
64-
USER_ROLE_PROPERTY_NAME: process.env.USER_ROLE_PROPERTY_NAME || 'roles',
65-
USER_SKILL_PROPERTY_NAME: process.env.USER_SKILL_PROPERTY_NAME || 'skills',
66-
USER_GROUP_PROPERTY_NAME: process.env.USER_GROUP_PROPERTY_NAME || 'groups',
67-
68-
ORGANIZATION_SKILLPROVIDER_PROPERTY_NAME: process.env.ORGANIZATION_SKILLPROVIDER_PROPERTY_NAME || 'skillProviders',
69-
7034
ENRICHMENT: {
71-
attributegroup: {
72-
enrichPolicyName: process.env.ATTRIBUTE_GROUP_ENRICH_POLICYNAME || 'attributegroup-policy',
73-
pipelineId: process.env.ATTRIBUTE_GROUP_PIPELINE_ID || 'attributegroup-pipeline'
74-
},
75-
skillprovider: {
76-
enrichPolicyName: process.env.SKILL_PROVIDER_ENRICH_POLICYNAME || 'skillprovider-policy',
77-
pipelineId: process.env.SKILL_PROVIDER_PIPELINE_ID || 'skillprovider-pipeline'
78-
},
7935
user: {
8036
pipelineId: process.env.USER_PIPELINE_ID || 'user-pipeline'
81-
},
82-
role: {
83-
enrichPolicyName: process.env.ROLE_ENRICH_POLICYNAME || 'role-policy'
84-
},
85-
achievementprovider: {
86-
enrichPolicyName: process.env.ACHIEVEMENT_PROVIDER_ENRICH_POLICYNAME || 'achievementprovider-policy'
87-
},
88-
skill: {
89-
enrichPolicyName: process.env.SKILL_ENRICH_POLICYNAME || 'skill-policy'
90-
},
91-
attribute: {
92-
enrichPolicyName: process.env.ATTRIBUTE_ENRICH_POLICYNAME || 'attribute-policy'
93-
},
94-
organization: {
95-
enrichPolicyName: process.env.ORGANIZATION_ENRICH_POLICYNAME || 'organization-policy'
96-
},
97-
// sub resources under user
98-
achievement: {
99-
userField: process.env.USER_ACHIEVEMENT_PROPERTY_NAME || 'achievements'
100-
},
101-
externalprofile: {
102-
userField: process.env.USER_EXTERNALPROFILE_PROPERTY_NAME || 'externalProfiles'
103-
},
104-
userattribute: {
105-
userField: process.env.USER_ATTRIBUTE_PROPERTY_NAME || 'attributes'
106-
},
107-
userrole: {
108-
userField: process.env.USER_ROLE_PROPERTY_NAME || 'roles'
109-
},
110-
userskill: {
111-
userField: process.env.USER_SKILL_PROPERTY_NAME || 'skills'
112-
},
113-
// sub resources under organization
114-
organizationskillprovider: {
115-
orgField: process.env.ORGANIZATION_SKILLPROVIDER_PROPERTY_NAME || 'skillProviders'
11637
}
11738
}
11839
}

‎config/test.js

Lines changed: 0 additions & 17 deletions
This file was deleted.

‎docker-kafka-es/docker-compose.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ services:
1212
- "9092:9092"
1313
environment:
1414
KAFKA_ADVERTISED_HOST_NAME: localhost
15-
KAFKA_CREATE_TOPICS: "u-bahn.action.aggregate:1:1,groups.notification.member.add:1:1,groups.notification.member.delete:1:1"
15+
KAFKA_CREATE_TOPICS: "groups.notification.member.add:1:1,groups.notification.member.delete:1:1"
1616
KAFKA_ZOOKEEPER_CONNECT: zookeeper:2181
1717
esearch:
1818
image: elasticsearch:7.7.1

‎docker/api.env

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+

‎package-lock.json

Lines changed: 27 additions & 1899 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎package.json

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -6,23 +6,12 @@
66
"scripts": {
77
"start": "node src/app.js",
88
"lint": "standard",
9-
"lint:fix": "standard --fix",
10-
"view-data": "node test/common/view-data.js",
11-
"test": "mocha test/unit/test.js --require test/unit/prepare.js --timeout 20000 --exit",
12-
"test:cov": "nyc --reporter=html --reporter=text mocha test/unit/test.js --require test/unit/prepare.js --timeout 20000 --exit",
13-
"e2e": "mocha test/e2e/test.js --timeout 20000 --exit",
14-
"e2e:cov": "nyc --reporter=html --reporter=text mocha test/e2e/test.js --timeout 20000 --exit"
9+
"lint:fix": "standard --fix"
1510
},
1611
"author": "TCSCODER",
1712
"license": "none",
1813
"devDependencies": {
19-
"mocha": "^7.1.2",
20-
"mocha-prepare": "^0.1.0",
21-
"nock": "^12.0.3",
22-
"nyc": "^14.1.1",
23-
"should": "^13.2.3",
24-
"standard": "^12.0.1",
25-
"superagent": "^5.1.0"
14+
"standard": "^12.0.1"
2615
},
2716
"dependencies": {
2817
"@elastic/elasticsearch": "^7.9.1",
@@ -35,7 +24,6 @@
3524
"lodash": "^4.17.19",
3625
"no-kafka": "^3.4.3",
3726
"axios": "^0.19.2",
38-
"tc-core-library-js": "appirio-tech/tc-core-library-js.git#v2.6",
3927
"topcoder-healthcheck-dropin": "^1.0.3",
4028
"winston": "^3.2.1"
4129
},

‎src/app.js

Lines changed: 2 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ const _ = require('lodash')
99
const healthcheck = require('topcoder-healthcheck-dropin')
1010
const logger = require('./common/logger')
1111
const helper = require('./common/helper')
12-
const ProcessorService = require('./services/ProcessorService')
1312
const GroupsProcessorService = require('./services/GroupsProcessorService')
1413
const Mutex = require('async-mutex').Mutex
1514

@@ -70,21 +69,7 @@ const dataHandler = (messageSet, topic, partition) => Promise.each(messageSet, a
7069
}
7170
const transactionId = _.uniqueId('transaction_')
7271
try {
73-
if (messageJSON.payload.originalTopic) {
74-
switch (messageJSON.payload.originalTopic) {
75-
case config.UBAHN_CREATE_TOPIC:
76-
await ProcessorService.processCreate(messageJSON, transactionId)
77-
break
78-
case config.UBAHN_UPDATE_TOPIC:
79-
await ProcessorService.processUpdate(messageJSON, transactionId)
80-
break
81-
case config.UBAHN_DELETE_TOPIC:
82-
await ProcessorService.processDelete(messageJSON, transactionId)
83-
break
84-
default:
85-
throw new Error(`Unknown original topic: ${messageJSON.payload.originalTopic}`)
86-
}
87-
} else {
72+
if (!messageJSON.payload.originalTopic) {
8873
switch (topic) {
8974
case config.GROUPS_MEMBER_ADD_TOPIC:
9075
await GroupsProcessorService.processMemberAdd(messageJSON, transactionId)
@@ -122,8 +107,7 @@ const check = () => {
122107
return connected
123108
}
124109

125-
// const topics = [config.UBAHN_CREATE_TOPIC, config.UBAHN_UPDATE_TOPIC, config.UBAHN_DELETE_TOPIC]
126-
const topics = [config.UBAHN_AGGREGATE_TOPIC, config.GROUPS_MEMBER_ADD_TOPIC, config.GROUPS_MEMBER_DELETE_TOPIC]
110+
const topics = [config.GROUPS_MEMBER_ADD_TOPIC, config.GROUPS_MEMBER_DELETE_TOPIC]
127111

128112
consumer
129113
.init([{

‎src/common/constants.js

Lines changed: 0 additions & 177 deletions
This file was deleted.

‎src/common/helper.js

Lines changed: 0 additions & 69 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,7 @@ const elasticsearch = require('@elastic/elasticsearch')
88
const _ = require('lodash')
99
const Joi = require('@hapi/joi')
1010
const { Mutex } = require('async-mutex')
11-
const axios = require('axios')
1211
const logger = require('./logger')
13-
const m2mAuth = require('tc-core-library-js').auth.m2m
14-
const topcoderM2M = m2mAuth(_.pick(config, ['AUTH0_URL', 'AUTH0_AUDIENCE', 'TOKEN_CACHE_TIME', 'AUTH0_PROXY_SERVER_URL']))
1512

1613
AWS.config.region = config.ES.AWS_REGION
1714

@@ -22,34 +19,6 @@ let transactionId
2219
const esClientMutex = new Mutex()
2320
const mutexReleaseMap = {}
2421

25-
/* Function to get M2M token
26-
* (Topcoder APIs only)
27-
* @returns {Promise}
28-
*/
29-
async function getTopcoderM2Mtoken () {
30-
return topcoderM2M.getMachineToken(config.AUTH0_CLIENT_ID, config.AUTH0_CLIENT_SECRET)
31-
}
32-
33-
/**
34-
* Returns the user in Topcoder identified by the email
35-
* @param {String} email The user email
36-
*/
37-
async function getUserGroup (memberId) {
38-
const url = config.TOPCODER_GROUP_API
39-
const token = await getTopcoderM2Mtoken()
40-
const params = { memberId, membershipType: 'user', page: 1 }
41-
42-
logger.debug(`request GET ${url} with params: ${JSON.stringify(params)}`)
43-
let groups = []
44-
let groupRes = await axios.get(url, { headers: { Authorization: `Bearer ${token}` }, params })
45-
while (groupRes.data.length > 0) {
46-
groups = _.concat(groups, _.map(groupRes.data, g => _.pick(g, 'id', 'name')))
47-
params.page = params.page + 1
48-
groupRes = await axios.get(url, { headers: { Authorization: `Bearer ${token}` }, params })
49-
}
50-
return groups
51-
}
52-
5322
/**
5423
* Get Kafka options
5524
* @return {Object} the Kafka options
@@ -175,41 +144,6 @@ async function updateUser (userId, body, seqNo, primaryTerm, transactionId) {
175144
}
176145
}
177146

178-
/**
179-
* Function to get org from es
180-
* @param {String} organizationId
181-
* @param {String} transactionId
182-
* @returns {Object} organization
183-
*/
184-
async function getOrg (organizationId, transactionId) {
185-
const client = await getESClient()
186-
const { body: org } = await client.get({ index: config.get('ES.ORGANIZATION_INDEX'), type: config.get('ES.ORGANIZATION_TYPE'), id: organizationId, transactionId })
187-
return { seqNo: org._seq_no, primaryTerm: org._primary_term, org: org._source }
188-
}
189-
190-
/**
191-
* Function to update es organization
192-
* @param {String} organizationId
193-
* @param {Number} seqNo
194-
* @param {Number} primaryTerm
195-
* @param {String} transactionId
196-
* @param {Object} body
197-
*/
198-
async function updateOrg (organizationId, body, seqNo, primaryTerm, transactionId) {
199-
const client = await getESClient()
200-
await client.index({
201-
index: config.get('ES.ORGANIZATION_INDEX'),
202-
type: config.get('ES.ORGANIZATION_TYPE'),
203-
id: organizationId,
204-
transactionId,
205-
body,
206-
if_seq_no: seqNo,
207-
if_primary_term: primaryTerm,
208-
refresh: 'wait_for'
209-
})
210-
await client.enrich.executePolicy({ name: config.get('ES.ENRICHMENT.organization.enrichPolicyName') })
211-
}
212-
213147
/**
214148
* Fuction to get an Error with statusCode property
215149
* @param {String} message error message
@@ -242,10 +176,7 @@ module.exports = {
242176
getESClient,
243177
validProperties,
244178
getUser,
245-
getUserGroup,
246179
updateUser,
247-
getOrg,
248-
updateOrg,
249180
getErrorWithStatus,
250181
checkEsMutexRelease
251182
}

‎src/services/ProcessorService.js

Lines changed: 0 additions & 279 deletions
This file was deleted.

‎test/common/init-es.js

Lines changed: 0 additions & 61 deletions
This file was deleted.

‎test/common/testData.js

Lines changed: 0 additions & 702 deletions
This file was deleted.

‎test/common/testHelper.js

Lines changed: 0 additions & 99 deletions
This file was deleted.

‎test/common/view-data.js

Lines changed: 0 additions & 40 deletions
This file was deleted.

‎test/e2e/test.js

Lines changed: 0 additions & 345 deletions
This file was deleted.

‎test/unit/prepare.js

Lines changed: 0 additions & 90 deletions
This file was deleted.

‎test/unit/test.js

Lines changed: 0 additions & 239 deletions
This file was deleted.

0 commit comments

Comments
 (0)
This repository has been archived.