diff --git a/src/scripts/createIndex.js b/src/scripts/createIndex.js index dc0d213..987df1b 100644 --- a/src/scripts/createIndex.js +++ b/src/scripts/createIndex.js @@ -50,18 +50,29 @@ async function createIndex () { type: 'nested', properties: { id: { type: 'keyword' }, + xaiId: { type: 'keyword' }, jobCandidateId: { type: 'keyword' }, - googleCalendarId: { type: 'keyword' }, - customMessage: { type: 'text' }, - xaiTemplate: { type: 'keyword' }, - round: { type: 'integer' }, + calendarEventId: { type: 'keyword' }, + templateUrl: { type: 'keyword' }, + templateId: { type: 'keyword' }, + templateType: { type: 'keyword' }, + title: { type: 'keyword' }, + locationDetails: { type: 'keyword' }, + duration: { type: 'integer' }, startTimestamp: { type: 'date' }, - attendeesList: [], + endTimestamp: { type: 'date' }, + hostName: { type: 'keyword' }, + hostEmail: { type: 'keyword' }, + guestNames: { type: 'keyword' }, + guestEmails: { type: 'keyword' }, + round: { type: 'integer' }, status: { type: 'keyword' }, + rescheduleUrl: { type: 'keyword' }, createdAt: { type: 'date' }, createdBy: { type: 'keyword' }, updatedAt: { type: 'date' }, - updatedBy: { type: 'keyword' } + updatedBy: { type: 'keyword' }, + deletedAt: { type: 'date' } } }, createdAt: { type: 'date' }, diff --git a/src/services/InterviewProcessorService.js b/src/services/InterviewProcessorService.js index 2c3d595..b7d2e2e 100644 --- a/src/services/InterviewProcessorService.js +++ b/src/services/InterviewProcessorService.js @@ -58,18 +58,29 @@ processRequestInterview.schema = { 'mime-type': Joi.string().required(), payload: Joi.object().keys({ id: Joi.string().uuid().required(), + xaiId: Joi.string().allow(null), jobCandidateId: Joi.string().uuid().required(), - googleCalendarId: Joi.string().allow(null), - customMessage: Joi.string().allow(null), - xaiTemplate: Joi.xaiTemplate().required(), + calendarEventId: Joi.string().allow(null), + templateUrl: Joi.xaiTemplate().required(), + templateId: Joi.string().allow(null), + templateType: Joi.string().allow(null), + title: Joi.string().allow(null), + locationDetails: Joi.string().allow(null), round: Joi.number().integer().positive().required(), + duration: Joi.number().integer().positive().required(), startTimestamp: Joi.date().allow(null), - attendeesList: Joi.array().items(Joi.string().email()).allow(null), + endTimestamp: Joi.date().allow(null), + hostName: Joi.string().required(), + hostEmail: Joi.string().email().required(), + guestNames: Joi.array().items(Joi.string()).allow(null), + guestEmails: Joi.array().items(Joi.string().email()).allow(null), status: Joi.interviewStatus().required(), + rescheduleUrl: Joi.string().allow(null), createdAt: Joi.date().required(), createdBy: Joi.string().uuid().required(), updatedAt: Joi.date().allow(null), - updatedBy: Joi.string().uuid().allow(null) + updatedBy: Joi.string().uuid().allow(null), + deletedAt: Joi.date().allow(null) }).required() }).required(), transactionId: Joi.string().required() diff --git a/src/services/JobCandidateProcessorService.js b/src/services/JobCandidateProcessorService.js index 051af9a..48d8660 100644 --- a/src/services/JobCandidateProcessorService.js +++ b/src/services/JobCandidateProcessorService.js @@ -25,8 +25,8 @@ async function updateCandidateStatus ({ type, payload, previousData }) { localLogger.debug({ context: 'updateCandidateStatus', message: `jobCandidate is already in status: ${payload.status}` }) return } - //if (!['rejected', 'shortlist',].includes(payload.status)) { - if (!['client rejected - screening', 'client rejected - interview','interview','selected'].includes(payload.status)) { + // if (!['rejected', 'shortlist',].includes(payload.status)) { + if (!['client rejected - screening', 'client rejected - interview', 'interview', 'selected'].includes(payload.status)) { localLogger.debug({ context: 'updateCandidateStatus', message: `not interested status: ${payload.status}` }) return }