Skip to content

Commit 5ca8b61

Browse files
authored
Merge pull request #503 from topcoder-platform/dev
[PROD] Next Release
2 parents 136a574 + a65cffc commit 5ca8b61

31 files changed

+13123
-213
lines changed

.circleci/config.yml

+1
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ workflows:
6969
only:
7070
- dev
7171
- change-validatations-in-job-jc
72+
- feature/enriching-skills-data-with-api-2
7273

7374
# Production builds are exectuted only on tagged commits to the
7475
# master branch.

app-constants.js

+10-3
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@
55
const UserRoles = {
66
BookingManager: 'bookingmanager',
77
Administrator: 'administrator',
8-
ConnectManager: 'Connect Manager'
8+
ConnectManager: 'Connect Manager',
9+
TopcoderUser: 'Topcoder User'
910
}
1011

1112
const FullManagePermissionRoles = [
@@ -113,11 +114,11 @@ const WorkPeriodPaymentStatus = {
113114
* The top rule has priority over the bottom rules.
114115
*/
115116
const PaymentStatusRules = [
116-
{ paymentStatus: AggregatePaymentStatus.NO_DAYS, condition: { daysWorked: 0 } },
117117
{ paymentStatus: AggregatePaymentStatus.IN_PROGRESS, condition: { hasWorkPeriodPaymentStatus: [WorkPeriodPaymentStatus.SCHEDULED, WorkPeriodPaymentStatus.IN_PROGRESS] } },
118118
{ paymentStatus: AggregatePaymentStatus.COMPLETED, condition: { hasWorkPeriodPaymentStatus: [WorkPeriodPaymentStatus.COMPLETED], hasDueDays: false } },
119119
{ paymentStatus: AggregatePaymentStatus.PARTIALLY_COMPLETED, condition: { hasWorkPeriodPaymentStatus: [WorkPeriodPaymentStatus.COMPLETED], hasDueDays: true } },
120-
{ paymentStatus: AggregatePaymentStatus.PENDING, condition: { hasDueDays: true } }
120+
{ paymentStatus: AggregatePaymentStatus.PENDING, condition: { hasDueDays: true } },
121+
{ paymentStatus: AggregatePaymentStatus.NO_DAYS, condition: { daysWorked: 0 } }
121122
]
122123

123124
/**
@@ -143,6 +144,11 @@ const PaymentProcessingSwitch = {
143144
OFF: 'OFF'
144145
}
145146

147+
const WeeklySurveySwitch = {
148+
ON: 'ON',
149+
OFF: 'OFF'
150+
}
151+
146152
const PaymentSchedulerStatus = {
147153
START_PROCESS: 'start-process',
148154
CREATE_CHALLENGE: 'create-challenge',
@@ -172,6 +178,7 @@ module.exports = {
172178
PaymentSchedulerStatus,
173179
PaymentProcessingSwitch,
174180
PaymentStatusRules,
181+
WeeklySurveySwitch,
175182
ActiveWorkPeriodPaymentStatuses,
176183
JobStatus,
177184
JobCandidateStatus

app.js

+10-7
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@ const eventHandlers = require('./src/eventHandlers')
1515
const interviewService = require('./src/services/InterviewService')
1616
const { processScheduler } = require('./src/services/PaymentSchedulerService')
1717
const { sendSurveys } = require('./src/services/SurveyService')
18-
const emailNotificationService = require('./src/services/EmailNotificationService')
18+
const notificationSchedulerService = require('./src/services/NotificationsSchedulerService')
19+
const { WeeklySurveySwitch } = require('./app-constants')
1920

2021
// setup express app
2122
const app = express()
@@ -101,15 +102,17 @@ const server = app.listen(app.get('port'), () => {
101102
// schedule updateCompletedInterviews to run every hour
102103
schedule.scheduleJob('0 0 * * * *', interviewService.updateCompletedInterviews)
103104
// schedule sendSurveys
104-
schedule.scheduleJob(config.WEEKLY_SURVEY.CRON, sendSurveys)
105+
if (WeeklySurveySwitch.ON === config.WEEKLY_SURVEY.SWITCH) {
106+
schedule.scheduleJob(config.WEEKLY_SURVEY.CRON, sendSurveys)
107+
}
105108
// schedule payment processing
106109
schedule.scheduleJob(config.PAYMENT_PROCESSING.CRON, processScheduler)
107110

108-
schedule.scheduleJob(config.CRON_CANDIDATE_REVIEW, emailNotificationService.sendCandidatesAvailableEmails)
109-
schedule.scheduleJob(config.CRON_INTERVIEW_COMING_UP, emailNotificationService.sendInterviewComingUpEmails)
110-
schedule.scheduleJob(config.CRON_INTERVIEW_COMPLETED, emailNotificationService.sendInterviewCompletedEmails)
111-
schedule.scheduleJob(config.CRON_POST_INTERVIEW, emailNotificationService.sendPostInterviewActionEmails)
112-
schedule.scheduleJob(config.CRON_UPCOMING_RESOURCE_BOOKING, emailNotificationService.sendResourceBookingExpirationEmails)
111+
schedule.scheduleJob(config.CRON_CANDIDATE_REVIEW, notificationSchedulerService.sendCandidatesAvailableNotifications)
112+
schedule.scheduleJob(config.CRON_INTERVIEW_COMING_UP, notificationSchedulerService.sendInterviewComingUpNotifications)
113+
schedule.scheduleJob(config.CRON_INTERVIEW_COMPLETED, notificationSchedulerService.sendInterviewCompletedNotifications)
114+
schedule.scheduleJob(config.CRON_POST_INTERVIEW, notificationSchedulerService.sendPostInterviewActionNotifications)
115+
schedule.scheduleJob(config.CRON_UPCOMING_RESOURCE_BOOKING, notificationSchedulerService.sendResourceBookingExpirationNotifications)
113116
})
114117

115118
if (process.env.NODE_ENV === 'test') {

config/default.js

+14-3
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,12 @@ module.exports = {
3333

3434
// the Topcoder v5 url
3535
TC_API: process.env.TC_API || 'https://api.topcoder-dev.com/v5',
36+
// the Topcoder Beta API url currently v5.1
37+
TC_BETA_API: process.env.TC_BETA_API || 'https://api.topcoder-dev.com/v5.1',
3638
// the organization id
3739
ORG_ID: process.env.ORG_ID || '36ed815b-3da1-49f1-a043-aaed0a4e81ad',
38-
// the referenced skill provider id
39-
TOPCODER_SKILL_PROVIDER_ID: process.env.TOPCODER_SKILL_PROVIDER_ID || '9cc0795a-6e12-4c84-9744-15858dba1861',
40+
// the referenced taxonomy id
41+
TOPCODER_TAXONOMY_ID: process.env.TOPCODER_TAXONOMY_ID || '9cc0795a-6e12-4c84-9744-15858dba1861',
4042

4143
TOPCODER_USERS_API: process.env.TOPCODER_USERS_API || 'https://api.topcoder-dev.com/v3/users',
4244
// the api to find topcoder members
@@ -142,6 +144,8 @@ module.exports = {
142144
TAAS_ROLE_UPDATE_TOPIC: process.env.TAAS_ROLE_UPDATE_TOPIC || 'taas.role.update',
143145
// the delete role entity Kafka message topic
144146
TAAS_ROLE_DELETE_TOPIC: process.env.TAAS_ROLE_DELETE_TOPIC || 'taas.role.delete',
147+
// the create team entity message topic, only used for eventHandler
148+
TAAS_TEAM_CREATE_TOPIC: process.env.TAAS_TEAM_CREATE_TOPIC || 'taas.team.create',
145149
// special kafka topics
146150
TAAS_ACTION_RETRY_TOPIC: process.env.TAAS_ACTION_RETRY_TOPIC || 'taas.action.retry',
147151

@@ -161,6 +165,10 @@ module.exports = {
161165
// INTERVIEW_INVITATION_RECIPIENTS_LIST may contain comma-separated list of email which is converted to array
162166
// scheduler@x.ai should be in the RECIPIENTS list
163167
INTERVIEW_INVITATION_RECIPIENTS_LIST: (process.env.INTERVIEW_INVITATION_RECIPIENTS_LIST || '[email protected]').split(','),
168+
// the emails address for overlapping interview
169+
NOTIFICATION_OPS_EMAILS: (process.env.NOTIFICATION_OPS_EMAILS || '[email protected]').split(','),
170+
// the slack channel for sending notifications
171+
NOTIFICATION_SLACK_CHANNEL: process.env.NOTIFICATION_SLACK_CHANNEL || '#tass-notification',
164172
// SendGrid email template ID for reporting issue
165173
REPORT_ISSUE_SENDGRID_TEMPLATE_ID: process.env.REPORT_ISSUE_SENDGRID_TEMPLATE_ID,
166174
// SendGrid email template ID for requesting extension
@@ -184,6 +192,7 @@ module.exports = {
184192
TOPCODER_SKILLS_CACHE_TIME: process.env.TOPCODER_SKILLS_CACHE_TIME || 60,
185193
// weekly survey scheduler config
186194
WEEKLY_SURVEY: {
195+
SWITCH: process.env.WEEKLY_SURVEY_SWITCH || 'OFF',
187196
CRON: process.env.WEEKLY_SURVEY_CRON || '0 1 * * 7',
188197
BASE_URL: process.env.WEEKLY_SURVEY_BASE_URL || 'https://api.surveymonkey.net/v3/surveys',
189198
JWT_TOKEN: process.env.WEEKLY_SURVEY_JWT_TOKEN || '',
@@ -268,5 +277,7 @@ module.exports = {
268277
RESOURCE_BOOKING_EXPIRY_TIME: process.env.RESOURCE_BOOKING_EXPIRY_TIME || 'P21D',
269278
// The Stripe
270279
STRIPE_SECRET_KEY: process.env.STRIPE_SECRET_KEY,
271-
CURRENCY: process.env.CURRENCY || 'usd'
280+
CURRENCY: process.env.CURRENCY || 'usd',
281+
// RCRM base URL
282+
RCRM_APP_URL: process.env.RCRM_APP_URL || 'https://app.recruitcrm.io'
272283
}

config/email_template.config.js

+42
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,13 @@ module.exports = {
111111
* List all kind of emails which could be send as Email Notifications by scheduler, API endpoints or anything else.
112112
*/
113113
notificationEmailTemplates: {
114+
'taas.notification.job-candidate-resume-viewed': {
115+
subject: 'Topcoder - Client View Resume for Job {{jobName}}',
116+
body: '',
117+
recipients: [],
118+
from: config.NOTIFICATION_SENDER_EMAIL,
119+
sendgridTemplateId: config.NOTIFICATION_SENDGRID_TEMPLATE_ID
120+
},
114121
'taas.notification.candidates-available-for-review': {
115122
subject: 'Topcoder - {{teamName}} has job candidates available for review',
116123
body: '',
@@ -152,6 +159,41 @@ module.exports = {
152159
recipients: [],
153160
from: config.NOTIFICATION_SENDER_EMAIL,
154161
sendgridTemplateId: config.NOTIFICATION_SENDGRID_TEMPLATE_ID
162+
},
163+
'taas.notification.team-created': {
164+
subject: 'Topcoder - New Team {{teamName}} Created',
165+
body: '',
166+
recipients: [],
167+
from: config.NOTIFICATION_SENDER_EMAIL,
168+
sendgridTemplateId: config.NOTIFICATION_SENDGRID_TEMPLATE_ID
169+
},
170+
'taas.notification.job-created': {
171+
subject: 'Topcoder - New Job {{jobTitle}} Created in Team {{teamName}}',
172+
body: '',
173+
recipients: [],
174+
from: config.NOTIFICATION_SENDER_EMAIL,
175+
sendgridTemplateId: config.NOTIFICATION_SENDGRID_TEMPLATE_ID
176+
},
177+
'taas.notification.interviews-overlapping': {
178+
subject: 'Topcoder - Interviews overlapping',
179+
body: '',
180+
recipients: config.NOTIFICATION_OPS_EMAILS,
181+
from: config.NOTIFICATION_SENDER_EMAIL,
182+
sendgridTemplateId: config.NOTIFICATION_SENDGRID_TEMPLATE_ID
183+
},
184+
'taas.notification.job-candidate-selected': {
185+
subject: 'Topcoder - Job Candidate {{userHandle}} Selected for {{jobTitle}} in Team {{teamName}}',
186+
body: '',
187+
recipients: config.NOTIFICATION_OPS_EMAILS,
188+
from: config.NOTIFICATION_SENDER_EMAIL,
189+
sendgridTemplateId: config.NOTIFICATION_SENDGRID_TEMPLATE_ID
190+
},
191+
'taas.notification.resource-booking-placed': {
192+
subject: 'Topcoder - Resource Booking {{userHandle}} Placed for Job {{jobTitle}} in Team {{teamName}}',
193+
body: '',
194+
recipients: [],
195+
from: config.NOTIFICATION_SENDER_EMAIL,
196+
sendgridTemplateId: config.NOTIFICATION_SENDGRID_TEMPLATE_ID
155197
}
156198
}
157199
}

0 commit comments

Comments
 (0)