Skip to content
This repository was archived by the owner on Mar 13, 2025. It is now read-only.

Shapeup#4 CQRS standards update #16

Merged
merged 6 commits into from
Sep 21, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 0 additions & 29 deletions src/common/helper.js
Original file line number Diff line number Diff line change
Expand Up @@ -119,33 +119,6 @@ async function getAttributes (token) {
}
}

/**
* Get all skills
* * Unused for now. Retained for any future use
* @param {String} token
* @returns a map (name -> id)
*/
async function getSkillProviderId (token) {
const res = await axios.get(`${config.UBAHN_API_URL}/skillsProviders`, { headers: { Authorization: `Bearer ${token}` }, params: { name: config.SKILL_PROVIDER_NAME } })
if (res.data && res.data.length > 0) {
return res.data[0].id
}
}

/**
* Get the skillId
* * Unused for now. Retained for any future use
* @param {String} skillProviderId
* @param {String} name
* @param {String} token
*/
async function getSkillId (skillProviderId, name, token) {
const res = await axios.get(`${config.UBAHN_API_URL}/skills`, { headers: { Authorization: `Bearer ${token}` }, params: { skillProviderId, name } })
if (res.data && res.data.length > 0) {
return res.data[0].id
}
}

/**
* Returns the member location for the member handle
* * Unused for now. Retained for any future use
Expand Down Expand Up @@ -253,8 +226,6 @@ module.exports = {
getTopcoderToken,
getOrganizationId,
getAttributes,
getSkillProviderId,
getSkillId,
getMemberLocation,
getMemberSkills,
createUser,
Expand Down
10 changes: 5 additions & 5 deletions src/services/ProcessorService.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,22 +65,22 @@ async function processCreate (message, ubahnToken) {
isInactive: !message.payload.active
}, ubahnToken)
logger.info(`external profile: ${organizationId} created`)
await helper.sleep()
//await helper.sleep()
await helper.createUserAttribute(userId, _.get(attributes, 'isAvailable'), message.payload.active.toString(), ubahnToken)
logger.info('user attribute: isAvailable created')
await helper.sleep()
//await helper.sleep()
await helper.createUserAttribute(userId, _.get(attributes, 'company'), 'Topcoder', ubahnToken)
logger.info('user attribute: company created')
await helper.sleep()
//await helper.sleep()
await helper.createUserAttribute(userId, _.get(attributes, 'title'), 'Member', ubahnToken)
logger.info('user attribute: title created')
await helper.sleep()
//await helper.sleep()
await helper.createUserAttribute(userId, _.get(attributes, 'location'), location, ubahnToken)
logger.info('user attribute: location created')

// Custom attribute. May or may not exist
if (_.get(attributes, 'email')) {
helper.sleep()
//helper.sleep()
await helper.createUserAttribute(userId, _.get(attributes, 'email'), message.payload.email, ubahnToken)
logger.info('user attribute: email created')
}
Expand Down