Skip to content

[PROD] Next Release #503

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 45 commits into from
Aug 19, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
502744a
fix: issue #468
yoution Aug 10, 2021
cc75599
added demo requests for notifications into postman
maxceem Aug 11, 2021
974defe
enrich disintigration
Sande3p Aug 12, 2021
92ba3ce
fix: issue #468
yoution Aug 12, 2021
0faa3a3
imp API Triggered Notifications
xxcxy Aug 12, 2021
198d276
fix: issue #475
yoution Aug 13, 2021
47edf69
Merge pull request #478 from tcoDevs/feature/enrich
Aug 13, 2021
303277a
Implementing the review suggestions:
Aug 13, 2021
90c25ca
Merge pull request #470 from yoution/issue-468
maxceem Aug 13, 2021
ad4c66a
fix: issue #475
yoution Aug 13, 2021
b6bff7e
refactor
xxcxy Aug 13, 2021
3826c98
Merge pull request #482 from xxcxy/feature/notifications-api
maxceem Aug 14, 2021
58f9596
fix new team email URL
maxceem Aug 14, 2021
b98a7ca
improve email/slack notifications formatting
maxceem Aug 14, 2021
ddd7e64
Merge branch 'feature/notifications-api' into issue-475
maxceem Aug 14, 2021
8e8830e
Merge pull request #483 from yoution/issue-475
maxceem Aug 14, 2021
d337e83
Merge branch 'dev' into feature/notifications-api
maxceem Aug 14, 2021
7626753
remove demo slack webhook env var from global config
maxceem Aug 14, 2021
48b3625
update default slack notification channel name
maxceem Aug 14, 2021
0e0227a
fix WP status when only have additional payments
maxceem Aug 14, 2021
1418cd9
Renamed EmailNotificationService.js to NotificationsSchedulerService.js
tejad Aug 15, 2021
8348a23
fix: skills-api-shape-up : added env variable for the 5.1 api
Aug 16, 2021
6a0f941
Merge pull request #491 from topcoder-platform/featuer/fix-additional…
maxceem Aug 16, 2021
7bd6c8c
Merge pull request #487 from topcoder-platform/feature/enriching-skil…
nkumar-topcoder Aug 16, 2021
c090db8
Replacing subject placeholders
tejad Aug 16, 2021
8cb97d5
Merge pull request #492 from tejad/feature/notifications-api
maxceem Aug 16, 2021
88d8511
Revert "Handling missing skill data enrichment via API call"
maxceem Aug 16, 2021
0a03795
Merge pull request #496 from topcoder-platform/revert-487-feature/enr…
maxceem Aug 16, 2021
1ab03a3
Revert "Revert "Handling missing skill data enrichment via API call""
maxceem Aug 16, 2021
11fe5f1
Merge pull request #488 from topcoder-platform/hotfix/send-survey-wor…
nkumar-topcoder Aug 16, 2021
1ee0442
fix: issue with `/me` endpoint, we don’t need any change in the listU…
Aug 16, 2021
16cc100
Merge pull request #497 from topcoder-platform/revert-496-revert-487-…
maxceem Aug 16, 2021
dcbef2c
Merge branch 'dev' into feature/notifications-api
maxceem Aug 16, 2021
418f224
Merge pull request #490 from topcoder-platform/feature/notifications-api
maxceem Aug 16, 2021
015a8a7
Revert "New "Handling missing skill data enrichment via API call""
maxceem Aug 16, 2021
2455835
Merge pull request #498 from topcoder-platform/revert-497-revert-496-…
maxceem Aug 16, 2021
719487c
remove unnecessary async
maxceem Aug 16, 2021
f36704f
fix all team notifications recipietns
maxceem Aug 16, 2021
4f09fde
fix OPS recipients for email notifications
maxceem Aug 17, 2021
91b562c
fix job candidate selected text in slack notificaition
maxceem Aug 17, 2021
a09dc53
improve demo notifications postman
maxceem Aug 17, 2021
8dab6fa
added RCRM job link in candidate selected slack notification
maxceem Aug 17, 2021
d3ae667
allow downloading job candidate resume by direct link without token
maxceem Aug 18, 2021
5113817
Revert "allow downloading job candidate resume by direct link without…
maxceem Aug 18, 2021
a65cffc
Enriching skills without enrich Elastic.co feature (#501)
Aug 18, 2021
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
1 change: 1 addition & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ workflows:
only:
- dev
- change-validatations-in-job-jc
- feature/enriching-skills-data-with-api-2

# Production builds are exectuted only on tagged commits to the
# master branch.
Expand Down
13 changes: 10 additions & 3 deletions app-constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
const UserRoles = {
BookingManager: 'bookingmanager',
Administrator: 'administrator',
ConnectManager: 'Connect Manager'
ConnectManager: 'Connect Manager',
TopcoderUser: 'Topcoder User'
}

const FullManagePermissionRoles = [
Expand Down Expand Up @@ -113,11 +114,11 @@ const WorkPeriodPaymentStatus = {
* The top rule has priority over the bottom rules.
*/
const PaymentStatusRules = [
{ paymentStatus: AggregatePaymentStatus.NO_DAYS, condition: { daysWorked: 0 } },
{ paymentStatus: AggregatePaymentStatus.IN_PROGRESS, condition: { hasWorkPeriodPaymentStatus: [WorkPeriodPaymentStatus.SCHEDULED, WorkPeriodPaymentStatus.IN_PROGRESS] } },
{ paymentStatus: AggregatePaymentStatus.COMPLETED, condition: { hasWorkPeriodPaymentStatus: [WorkPeriodPaymentStatus.COMPLETED], hasDueDays: false } },
{ paymentStatus: AggregatePaymentStatus.PARTIALLY_COMPLETED, condition: { hasWorkPeriodPaymentStatus: [WorkPeriodPaymentStatus.COMPLETED], hasDueDays: true } },
{ paymentStatus: AggregatePaymentStatus.PENDING, condition: { hasDueDays: true } }
{ paymentStatus: AggregatePaymentStatus.PENDING, condition: { hasDueDays: true } },
{ paymentStatus: AggregatePaymentStatus.NO_DAYS, condition: { daysWorked: 0 } }
]

/**
Expand All @@ -143,6 +144,11 @@ const PaymentProcessingSwitch = {
OFF: 'OFF'
}

const WeeklySurveySwitch = {
ON: 'ON',
OFF: 'OFF'
}

const PaymentSchedulerStatus = {
START_PROCESS: 'start-process',
CREATE_CHALLENGE: 'create-challenge',
Expand Down Expand Up @@ -172,6 +178,7 @@ module.exports = {
PaymentSchedulerStatus,
PaymentProcessingSwitch,
PaymentStatusRules,
WeeklySurveySwitch,
ActiveWorkPeriodPaymentStatuses,
JobStatus,
JobCandidateStatus
Expand Down
17 changes: 10 additions & 7 deletions app.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ const eventHandlers = require('./src/eventHandlers')
const interviewService = require('./src/services/InterviewService')
const { processScheduler } = require('./src/services/PaymentSchedulerService')
const { sendSurveys } = require('./src/services/SurveyService')
const emailNotificationService = require('./src/services/EmailNotificationService')
const notificationSchedulerService = require('./src/services/NotificationsSchedulerService')
const { WeeklySurveySwitch } = require('./app-constants')

// setup express app
const app = express()
Expand Down Expand Up @@ -101,15 +102,17 @@ const server = app.listen(app.get('port'), () => {
// schedule updateCompletedInterviews to run every hour
schedule.scheduleJob('0 0 * * * *', interviewService.updateCompletedInterviews)
// schedule sendSurveys
schedule.scheduleJob(config.WEEKLY_SURVEY.CRON, sendSurveys)
if (WeeklySurveySwitch.ON === config.WEEKLY_SURVEY.SWITCH) {
schedule.scheduleJob(config.WEEKLY_SURVEY.CRON, sendSurveys)
}
// schedule payment processing
schedule.scheduleJob(config.PAYMENT_PROCESSING.CRON, processScheduler)

schedule.scheduleJob(config.CRON_CANDIDATE_REVIEW, emailNotificationService.sendCandidatesAvailableEmails)
schedule.scheduleJob(config.CRON_INTERVIEW_COMING_UP, emailNotificationService.sendInterviewComingUpEmails)
schedule.scheduleJob(config.CRON_INTERVIEW_COMPLETED, emailNotificationService.sendInterviewCompletedEmails)
schedule.scheduleJob(config.CRON_POST_INTERVIEW, emailNotificationService.sendPostInterviewActionEmails)
schedule.scheduleJob(config.CRON_UPCOMING_RESOURCE_BOOKING, emailNotificationService.sendResourceBookingExpirationEmails)
schedule.scheduleJob(config.CRON_CANDIDATE_REVIEW, notificationSchedulerService.sendCandidatesAvailableNotifications)
schedule.scheduleJob(config.CRON_INTERVIEW_COMING_UP, notificationSchedulerService.sendInterviewComingUpNotifications)
schedule.scheduleJob(config.CRON_INTERVIEW_COMPLETED, notificationSchedulerService.sendInterviewCompletedNotifications)
schedule.scheduleJob(config.CRON_POST_INTERVIEW, notificationSchedulerService.sendPostInterviewActionNotifications)
schedule.scheduleJob(config.CRON_UPCOMING_RESOURCE_BOOKING, notificationSchedulerService.sendResourceBookingExpirationNotifications)
})

if (process.env.NODE_ENV === 'test') {
Expand Down
17 changes: 14 additions & 3 deletions config/default.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,12 @@ module.exports = {

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

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

Expand All @@ -161,6 +165,10 @@ module.exports = {
// INTERVIEW_INVITATION_RECIPIENTS_LIST may contain comma-separated list of email which is converted to array
// [email protected] should be in the RECIPIENTS list
INTERVIEW_INVITATION_RECIPIENTS_LIST: (process.env.INTERVIEW_INVITATION_RECIPIENTS_LIST || '[email protected]').split(','),
// the emails address for overlapping interview
NOTIFICATION_OPS_EMAILS: (process.env.NOTIFICATION_OPS_EMAILS || '[email protected]').split(','),
// the slack channel for sending notifications
NOTIFICATION_SLACK_CHANNEL: process.env.NOTIFICATION_SLACK_CHANNEL || '#tass-notification',
// SendGrid email template ID for reporting issue
REPORT_ISSUE_SENDGRID_TEMPLATE_ID: process.env.REPORT_ISSUE_SENDGRID_TEMPLATE_ID,
// SendGrid email template ID for requesting extension
Expand All @@ -184,6 +192,7 @@ module.exports = {
TOPCODER_SKILLS_CACHE_TIME: process.env.TOPCODER_SKILLS_CACHE_TIME || 60,
// weekly survey scheduler config
WEEKLY_SURVEY: {
SWITCH: process.env.WEEKLY_SURVEY_SWITCH || 'OFF',
CRON: process.env.WEEKLY_SURVEY_CRON || '0 1 * * 7',
BASE_URL: process.env.WEEKLY_SURVEY_BASE_URL || 'https://api.surveymonkey.net/v3/surveys',
JWT_TOKEN: process.env.WEEKLY_SURVEY_JWT_TOKEN || '',
Expand Down Expand Up @@ -268,5 +277,7 @@ module.exports = {
RESOURCE_BOOKING_EXPIRY_TIME: process.env.RESOURCE_BOOKING_EXPIRY_TIME || 'P21D',
// The Stripe
STRIPE_SECRET_KEY: process.env.STRIPE_SECRET_KEY,
CURRENCY: process.env.CURRENCY || 'usd'
CURRENCY: process.env.CURRENCY || 'usd',
// RCRM base URL
RCRM_APP_URL: process.env.RCRM_APP_URL || 'https://app.recruitcrm.io'
}
42 changes: 42 additions & 0 deletions config/email_template.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,13 @@ module.exports = {
* List all kind of emails which could be send as Email Notifications by scheduler, API endpoints or anything else.
*/
notificationEmailTemplates: {
'taas.notification.job-candidate-resume-viewed': {
subject: 'Topcoder - Client View Resume for Job {{jobName}}',
body: '',
recipients: [],
from: config.NOTIFICATION_SENDER_EMAIL,
sendgridTemplateId: config.NOTIFICATION_SENDGRID_TEMPLATE_ID
},
'taas.notification.candidates-available-for-review': {
subject: 'Topcoder - {{teamName}} has job candidates available for review',
body: '',
Expand Down Expand Up @@ -152,6 +159,41 @@ module.exports = {
recipients: [],
from: config.NOTIFICATION_SENDER_EMAIL,
sendgridTemplateId: config.NOTIFICATION_SENDGRID_TEMPLATE_ID
},
'taas.notification.team-created': {
subject: 'Topcoder - New Team {{teamName}} Created',
body: '',
recipients: [],
from: config.NOTIFICATION_SENDER_EMAIL,
sendgridTemplateId: config.NOTIFICATION_SENDGRID_TEMPLATE_ID
},
'taas.notification.job-created': {
subject: 'Topcoder - New Job {{jobTitle}} Created in Team {{teamName}}',
body: '',
recipients: [],
from: config.NOTIFICATION_SENDER_EMAIL,
sendgridTemplateId: config.NOTIFICATION_SENDGRID_TEMPLATE_ID
},
'taas.notification.interviews-overlapping': {
subject: 'Topcoder - Interviews overlapping',
body: '',
recipients: config.NOTIFICATION_OPS_EMAILS,
from: config.NOTIFICATION_SENDER_EMAIL,
sendgridTemplateId: config.NOTIFICATION_SENDGRID_TEMPLATE_ID
},
'taas.notification.job-candidate-selected': {
subject: 'Topcoder - Job Candidate {{userHandle}} Selected for {{jobTitle}} in Team {{teamName}}',
body: '',
recipients: config.NOTIFICATION_OPS_EMAILS,
from: config.NOTIFICATION_SENDER_EMAIL,
sendgridTemplateId: config.NOTIFICATION_SENDGRID_TEMPLATE_ID
},
'taas.notification.resource-booking-placed': {
subject: 'Topcoder - Resource Booking {{userHandle}} Placed for Job {{jobTitle}} in Team {{teamName}}',
body: '',
recipients: [],
from: config.NOTIFICATION_SENDER_EMAIL,
sendgridTemplateId: config.NOTIFICATION_SENDGRID_TEMPLATE_ID
}
}
}
Loading