Skip to content

Commit 77c1eeb

Browse files
update naming
1 parent 3bd9d5a commit 77c1eeb

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

config/default.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -217,8 +217,8 @@ module.exports = {
217217
},
218218
// if a job reach this critier, system will automatically withdrawn other job applications.
219219
JOBS_HOUR_PER_WEEK: 20,
220-
// status mapping
221-
STATUS_MAPPING: {
220+
// the mapping includes the status transformation when auto-withdrawn feature is performed on job candidates.
221+
WITHDRAWN_STATUS_CHANGE_MAPPING: {
222222
applied: 'withdrawn-prescreen',
223223
'skills-test': 'withdrawn-prescreen',
224224
'phone-screen': 'withdrawn-prescreen',

src/eventHandlers/JobCandidateEventHandler.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,12 +70,12 @@ async function updateJobCandidates (statuses, userId) {
7070
logger.info({
7171
component: 'JobCandidateEventHandler',
7272
context: 'updateJobCandidates',
73-
message: `Begin update id: ${candidate.id}' candidate with ${candidate.status} status into ${config.STATUS_MAPPING[candidate.status]} for userId: ${userId}`
73+
message: `Begin update id: ${candidate.id}' candidate with ${candidate.status} status into ${config.WITHDRAWN_STATUS_CHANGE_MAPPING[candidate.status]} for userId: ${userId}`
7474
})
7575
await JobCandidateService.partiallyUpdateJobCandidate(
7676
helper.getAuditM2Muser(),
7777
candidate.id,
78-
{ status: config.STATUS_MAPPING[candidate.status] }
78+
{ status: config.WITHDRAWN_STATUS_CHANGE_MAPPING[candidate.status] }
7979
).then(result => {
8080
logger.info({
8181
component: 'JobCandidateEventHandler',
@@ -133,6 +133,7 @@ async function withDrawnJobCandidates (payload) {
133133
*/
134134
async function processCreate (payload) {
135135
await inReviewJob(payload)
136+
await withDrawnJobCandidates(payload)
136137
}
137138

138139
/**

0 commit comments

Comments
 (0)