Skip to content

Commit a9e4168

Browse files
author
sachin-maheshwari
authored
Merge pull request #70 from topcoder-platform/dev
tc-email-service release
2 parents 409acd4 + 594b7b3 commit a9e4168

File tree

3 files changed

+23
-16
lines changed

3 files changed

+23
-16
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@
5555
"pg": "^4.5.5",
5656
"pg-native": "^1.10.0",
5757
"sequelize": "^3.23.0",
58-
"tc-core-library-js": "appirio-tech/tc-core-library-js.git#v2.1",
58+
"tc-core-library-js": "appirio-tech/tc-core-library-js.git#v2.2",
5959
"traverse": "^0.6.6",
6060
"urlencode": "^1.1.0"
6161
},

src/constants.js

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -54,23 +54,24 @@ export const EVENT = {
5454
};
5555

5656
export const BUS_API_EVENT = {
57-
PROJECT_CREATED: 'connect.project.created',
58-
PROJECT_SUBMITTED_FOR_REVIEW: 'connect.project.submittedForReview',
59-
PROJECT_APPROVED: 'connect.project.approved',
60-
PROJECT_PAUSED: 'connect.project.paused',
61-
PROJECT_COMPLETED: 'connect.project.completed',
62-
PROJECT_CANCELED: 'connect.project.canceled',
57+
PROJECT_CREATED: 'notifications.connect.project.created',
58+
PROJECT_SUBMITTED_FOR_REVIEW: 'notifications.connect.project.submittedForReview',
59+
PROJECT_APPROVED: 'notifications.connect.project.approved',
60+
PROJECT_PAUSED: 'notifications.connect.project.paused',
61+
PROJECT_COMPLETED: 'notifications.connect.project.completed',
62+
PROJECT_CANCELED: 'notifications.connect.project.canceled',
63+
PROJECT_ACTIVE: 'notifications.connect.project.active',
6364

64-
MEMBER_JOINED: 'connect.project.member.joined',
65-
MEMBER_LEFT: 'connect.project.member.left',
66-
MEMBER_REMOVED: 'connect.project.member.removed',
67-
MEMBER_ASSIGNED_AS_OWNER: 'connect.project.member.assignedAsOwner',
68-
MEMBER_JOINED_COPILOT: 'connect.project.member.copilotJoined',
69-
MEMBER_JOINED_MANAGER: 'connect.project.member.managerJoined',
65+
MEMBER_JOINED: 'notifications.connect.project.member.joined',
66+
MEMBER_LEFT: 'notifications.connect.project.member.left',
67+
MEMBER_REMOVED: 'notifications.connect.project.member.removed',
68+
MEMBER_ASSIGNED_AS_OWNER: 'notifications.connect.project.member.assignedAsOwner',
69+
MEMBER_JOINED_COPILOT: 'notifications.connect.project.member.copilotJoined',
70+
MEMBER_JOINED_MANAGER: 'notifications.connect.project.member.managerJoined',
7071

71-
PROJECT_LINK_CREATED: 'connect.project.linkCreated',
72-
PROJECT_FILE_UPLOADED: 'connect.project.fileUploaded',
73-
PROJECT_SPECIFICATION_MODIFIED: 'connect.project.specificationModified',
72+
PROJECT_LINK_CREATED: 'notifications.connect.project.linkCreated',
73+
PROJECT_FILE_UPLOADED: 'notifications.connect.project.fileUploaded',
74+
PROJECT_SPECIFICATION_MODIFIED: 'notifications.connect.project.specificationModified',
7475
};
7576

7677
export const REGEX = {

src/events/busApi.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ const mapEventTypes = {
1414
[PROJECT_STATUS.COMPLETED]: BUS_API_EVENT.PROJECT_COMPLETED,
1515
[PROJECT_STATUS.CANCELLED]: BUS_API_EVENT.PROJECT_CANCELED,
1616
[PROJECT_STATUS.PAUSED]: BUS_API_EVENT.PROJECT_PAUSED,
17+
[PROJECT_STATUS.ACTIVE]: BUS_API_EVENT.PROJECT_ACTIVE,
1718
};
1819

1920
module.exports = (app, logger) => {
@@ -27,6 +28,7 @@ module.exports = (app, logger) => {
2728
createEvent(BUS_API_EVENT.PROJECT_CREATED, {
2829
projectId: project.id,
2930
projectName: project.name,
31+
userId: req.authUser.userId,
3032
initiatorUserId: req.authUser.userId,
3133
}, logger);
3234
});
@@ -42,6 +44,7 @@ module.exports = (app, logger) => {
4244
createEvent(mapEventTypes[updated.status], {
4345
projectId: updated.id,
4446
projectName: updated.name,
47+
userId: req.authUser.userId,
4548
initiatorUserId: req.authUser.userId,
4649
}, logger);
4750
} else if (
@@ -52,13 +55,15 @@ module.exports = (app, logger) => {
5255
createEvent(BUS_API_EVENT.PROJECT_SPECIFICATION_MODIFIED, {
5356
projectId: updated.id,
5457
projectName: updated.name,
58+
userId: req.authUser.userId,
5559
initiatorUserId: req.authUser.userId,
5660
}, logger);
5761
} else if (!_.isEqual(original.bookmarks, updated.bookmarks)) {
5862
logger.debug('project bookmarks is updated');
5963
createEvent(BUS_API_EVENT.PROJECT_LINK_CREATED, {
6064
projectId: updated.id,
6165
projectName: updated.name,
66+
userId: req.authUser.userId,
6267
initiatorUserId: req.authUser.userId,
6368
}, logger);
6469
}
@@ -166,6 +171,7 @@ module.exports = (app, logger) => {
166171
projectId,
167172
projectName: project.name,
168173
fileName: attachment.filePath.replace(/^.*[\\\/]/, ''), // eslint-disable-line
174+
userId: req.authUser.userId,
169175
initiatorUserId: req.authUser.userId,
170176
}, logger);
171177
}).catch(err => null); // eslint-disable-line no-unused-vars

0 commit comments

Comments
 (0)