File tree Expand file tree Collapse file tree 2 files changed +29
-9
lines changed Expand file tree Collapse file tree 2 files changed +29
-9
lines changed Original file line number Diff line number Diff line change @@ -23,17 +23,25 @@ async function inReviewJob (payload) {
2323 } )
2424 return
2525 }
26- await JobService . partiallyUpdateJob (
27- helper . getAuditM2Muser ( ) ,
28- job . id ,
29- { status : 'in-review' }
30- ) . then ( result => {
31- logger . info ( {
26+ if ( payload . value . status === 'open' ) {
27+ await JobService . partiallyUpdateJob (
28+ helper . getAuditM2Muser ( ) ,
29+ job . id ,
30+ { status : 'in-review' }
31+ ) . then ( result => {
32+ logger . info ( {
33+ component : 'JobCandidateEventHandler' ,
34+ context : 'inReviewJob' ,
35+ message : `id: ${ result . id } job got in-review status.`
36+ } )
37+ } )
38+ } else {
39+ logger . debug ( {
3240 component : 'JobCandidateEventHandler' ,
3341 context : 'inReviewJob' ,
34- message : `id: ${ result . id } job got in-review status. `
42+ message : `id: ${ payload . value . id } candidate is not in open status`
3543 } )
36- } )
44+ }
3745}
3846
3947/**
@@ -46,6 +54,17 @@ async function processCreate (payload) {
4654 await inReviewJob ( payload )
4755}
4856
57+ /**
58+ * Process job candidate update event.
59+ *
60+ * @param {Object } payload the event payload
61+ * @returns {undefined }
62+ */
63+ async function processUpdate ( payload ) {
64+ await inReviewJob ( payload )
65+ }
66+
4967module . exports = {
50- processCreate
68+ processCreate,
69+ processUpdate
5170}
Original file line number Diff line number Diff line change @@ -14,6 +14,7 @@ const logger = require('../common/logger')
1414const TopicOperationMapping = {
1515 [ config . TAAS_JOB_UPDATE_TOPIC ] : JobEventHandler . processUpdate ,
1616 [ config . TAAS_JOB_CANDIDATE_CREATE_TOPIC ] : JobCandidateEventHandler . processCreate ,
17+ [ config . TAAS_JOB_CANDIDATE_UPDATE_TOPIC ] : JobCandidateEventHandler . processUpdate ,
1718 [ config . TAAS_RESOURCE_BOOKING_CREATE_TOPIC ] : ResourceBookingEventHandler . processCreate ,
1819 [ config . TAAS_RESOURCE_BOOKING_UPDATE_TOPIC ] : ResourceBookingEventHandler . processUpdate ,
1920 [ config . TAAS_RESOURCE_BOOKING_DELETE_TOPIC ] : ResourceBookingEventHandler . processDelete ,
You can’t perform that action at this time.
0 commit comments