@@ -69,24 +69,24 @@ async function placeJobCandidate (payload) {
69
69
}
70
70
71
71
/**
72
- * Update the status of the Job to placed when it positions requirement is fullfilled .
72
+ * Update the status of the Job to assigned when it positions requirement is fulfilled .
73
73
*
74
74
* @param {Object } payload the event payload
75
75
* @returns {undefined }
76
76
*/
77
- async function placeJob ( payload ) {
77
+ async function assignJob ( payload ) {
78
78
if ( _ . get ( payload , 'options.oldValue' ) && payload . value . status === payload . options . oldValue . status ) {
79
79
logger . debug ( {
80
80
component : 'ResourceBookingEventHandler' ,
81
- context : 'placeJob ' ,
81
+ context : 'assignJob ' ,
82
82
message : 'status not changed'
83
83
} )
84
84
return
85
85
}
86
86
if ( payload . value . status !== 'placed' ) {
87
87
logger . debug ( {
88
88
component : 'ResourceBookingEventHandler' ,
89
- context : 'placeJob ' ,
89
+ context : 'assignJob ' ,
90
90
message : `not interested resource booking - status: ${ payload . value . status } `
91
91
} )
92
92
return
@@ -95,7 +95,7 @@ async function placeJob (payload) {
95
95
if ( ! resourceBooking . jobId ) {
96
96
logger . debug ( {
97
97
component : 'ResourceBookingEventHandler' ,
98
- context : 'placeJob ' ,
98
+ context : 'assignJob ' ,
99
99
message : `id: ${ resourceBooking . id } resource booking without jobId - ignored`
100
100
} )
101
101
return
@@ -104,7 +104,7 @@ async function placeJob (payload) {
104
104
if ( job . status === 'placed' ) {
105
105
logger . debug ( {
106
106
component : 'ResourceBookingEventHandler' ,
107
- context : 'placeJob ' ,
107
+ context : 'assignJob ' ,
108
108
message : `job with projectId ${ job . projectId } is already placed`
109
109
} )
110
110
return
@@ -117,12 +117,12 @@ async function placeJob (payload) {
117
117
} )
118
118
logger . debug ( {
119
119
component : 'ResourceBookingEventHandler' ,
120
- context : 'placeJob ' ,
120
+ context : 'assignJob ' ,
121
121
message : `the number of placed resource bookings is ${ resourceBookings . length } - the numPositions of the job is ${ job . numPositions } `
122
122
} )
123
123
if ( job . numPositions === resourceBookings . length ) {
124
- await JobService . partiallyUpdateJob ( helper . getAuditM2Muser ( ) , job . id , { status : 'placed ' } )
125
- logger . info ( { component : 'ResourceBookingEventHandler' , context : 'placeJob ' , message : `job ${ job . id } is placed ` } )
124
+ await JobService . partiallyUpdateJob ( helper . getAuditM2Muser ( ) , job . id , { status : 'assigned ' } )
125
+ logger . info ( { component : 'ResourceBookingEventHandler' , context : 'assignJob ' , message : `job ${ job . id } is assigned ` } )
126
126
}
127
127
}
128
128
@@ -295,7 +295,7 @@ async function _deleteWorkPeriods (workPeriods) {
295
295
*/
296
296
async function processCreate ( payload ) {
297
297
await placeJobCandidate ( payload )
298
- await placeJob ( payload )
298
+ await assignJob ( payload )
299
299
await createWorkPeriods ( payload )
300
300
}
301
301
@@ -307,7 +307,7 @@ async function processCreate (payload) {
307
307
*/
308
308
async function processUpdate ( payload ) {
309
309
await placeJobCandidate ( payload )
310
- await placeJob ( payload )
310
+ await assignJob ( payload )
311
311
await updateWorkPeriods ( payload )
312
312
}
313
313
0 commit comments