diff --git a/data/demo-data.json b/data/demo-data.json index 187f763a..03d62844 100644 --- a/data/demo-data.json +++ b/data/demo-data.json @@ -86,7 +86,7 @@ "isApplicationPageActive": false, "minSalary": 100, "maxSalary": 200, - "hoursPerWeek": 20, + "hoursPerWeek": 90, "jobLocation": "Any location", "jobTimezone": "GMT", "currency": "USD", @@ -833,9 +833,9 @@ }, { "id": "881a19de-2b0c-4bb9-b36a-4cb5e223bdb5", - "jobId": "728ff056-63f6-4730-8a9f-3074acad8479", + "jobId": "a8adb1f8-a6ee-48b1-8661-33bd851b726e", "userId": "a55fe1bc-1754-45fa-9adc-cf3d6d7c377a", - "status": "open", + "status": "placed", "externalId": "300234321", "resume": "http://example.com", "remark": "excellent", @@ -1645,11 +1645,11 @@ { "id": "c0a12936-77ef-46fa-8c75-6996339e79f6", "projectId": 111, - "userId": "05e988b7-7d54-4c10-ada1-1a04870a88a8", "jobId": "a8adb1f8-a6ee-48b1-8661-33bd851b726e", + "userId": "a55fe1bc-1754-45fa-9adc-cf3d6d7c377a", "status": "placed", "startDate": "2020-09-27", - "endDate": "2020-10-27", + "endDate": "2021-10-27", "memberRate": 13.23, "customerRate": 13, "rateType": "hourly", diff --git a/scripts/demo-email-notifications/index.js b/scripts/demo-email-notifications/index.js index 6a508f2b..7c19d2f3 100644 --- a/scripts/demo-email-notifications/index.js +++ b/scripts/demo-email-notifications/index.js @@ -23,7 +23,7 @@ async function resetNotificationRecords () { // reset coming up interview records localLogger.info('reset coming up interview records') const interview = await Interview.findById('976d23a9-5710-453f-99d9-f57a588bb610') - const startTimestamp = moment().add(moment.duration(`PT1H`)).add('PT1M').toDate() + const startTimestamp = moment().add(moment.duration('PT1H')).add('PT1M').toDate() await interview.update({ startTimestamp, duration: 30, status: Interviews.Status.Scheduled, guestNames: ['test1', 'test2'], hostName: 'hostName' }) // reset completed interview records diff --git a/scripts/withdrawn-migration/backup.js b/scripts/withdrawn-migration/backup.js index 3b3ea413..33cedc7f 100644 --- a/scripts/withdrawn-migration/backup.js +++ b/scripts/withdrawn-migration/backup.js @@ -24,8 +24,10 @@ async function backup () { } }) let summary = 0 + const processMapping = {} for (let i = 0; i < jobCandidates.length; i++) { const jc = jobCandidates[i] + if (processMapping[jc.userId]) continue let job = null try { job = await Job.findById(jc.jobId) @@ -60,17 +62,17 @@ async function backup () { where: filter }) if (candidates && candidates.length > 0) { - summary += candidates.length - fs.writeFile(filePath + `jobcandidate-backup-${i+1}.json`, JSON.stringify( - candidates - ), (err) => { - if (!err) { - logger.info({ component: `${currentStep} Sub`, message: `There are ${candidates.length} jobCandidates that need to be updated for userId: ${jc.userId}` }) - return - } + try { + fs.writeFileSync(filePath + `jobcandidate-backup-${i + 1}.json`, JSON.stringify( + candidates + )) + logger.info({ component: `${currentStep} Sub`, message: `There are ${candidates.length} jobCandidates that need to be updated for userId: ${jc.userId}` }) + summary += candidates.length + processMapping[jc.userId] = true + } catch (err) { logger.error({ component: currentStep, message: err.message }) process.exit(1) - }) + } } } }