diff --git a/README.md b/README.md index 9136fcc..2abb251 100644 --- a/README.md +++ b/README.md @@ -38,6 +38,9 @@ The following parameters can be set in config files or in env variables: - `topics.TAAS_INTERVIEW_REQUEST_TOPIC`: the request interview entity Kafka message topic - `topics.TAAS_INTERVIEW_UPDATE_TOPIC`: the update interview entity Kafka message topic - `topics.TAAS_INTERVIEW_BULK_UPDATE_TOPIC`: the bulk update interview entity Kafka message topic +- `topics.TAAS_ROLE_CREATE_TOPIC`: the create role entity Kafka message topic +- `topics.TAAS_ROLE_UPDATE_TOPIC`: the update role entity Kafka message topic +- `topics.TAAS_ROLE_DELETE_TOPIC`: the delete role entity Kafka message topic - `esConfig.HOST`: Elasticsearch host - `esConfig.AWS_REGION`: The Amazon region to use when using AWS Elasticsearch service - `esConfig.ELASTICCLOUD.id`: The elastic cloud id, if your elasticsearch instance is hosted on elastic cloud. DO NOT provide a value for ES_HOST if you are using this @@ -46,6 +49,7 @@ The following parameters can be set in config files or in env variables: - `esConfig.ES_INDEX_JOB`: the index name for job - `esConfig.ES_INDEX_JOB_CANDIDATE`: the index name for job candidate - `esConfig.ES_INDEX_RESOURCE_BOOKING`: the index name for resource booking +- `esConfig.ES_INDEX_ROLE`: the index name for role - `auth0.AUTH0_URL`: Auth0 URL, used to get TC M2M token - `auth0.AUTH0_AUDIENCE`: Auth0 audience, used to get TC M2M token diff --git a/VERIFICATION.md b/VERIFICATION.md index ef9046d..d6696f1 100644 --- a/VERIFICATION.md +++ b/VERIFICATION.md @@ -2,7 +2,7 @@ ## Create documents in ES -- Run the following commands to create `Job`, `JobCandidate`, `Interview`, `ResourceBooking`, `WorkPeriod`, `WorkPeriodPayment` documents in ES. +- Run the following commands to create `Job`, `JobCandidate`, `Interview`, `ResourceBooking`, `WorkPeriod`, `WorkPeriodPayment`, `Role` documents in ES. ``` bash # for Job @@ -17,12 +17,14 @@ docker exec -i taas-es-processor_kafka /opt/kafka/bin/kafka-console-producer.sh --broker-list localhost:9092 --topic taas.workperiod.create < test/messages/taas.workperiod.create.event.json # for WorkPeriodPayment docker exec -i taas-es-processor_kafka /opt/kafka/bin/kafka-console-producer.sh --broker-list localhost:9092 --topic taas.workperiodpayment.create < test/messages/taas.workperiodpayment.create.event.json + # for Role + docker exec -i taas-es-processor_kafka /opt/kafka/bin/kafka-console-producer.sh --broker-list localhost:9092 --topic taas.role.requested < test/messages/taas.role.create.event.json ``` - Run `npm run view-data ` to see if documents were created. ## Update documents in ES -- Run the following commands to update `Job`, `JobCandidate`, `Interview`, `ResourceBooking`, `WorkPeriod`, `WorkPeriodPayment` documents in ES. +- Run the following commands to update `Job`, `JobCandidate`, `Interview`, `ResourceBooking`, `WorkPeriod`, `WorkPeriodPayment`, `Role` documents in ES. ``` bash # for Job @@ -37,12 +39,14 @@ docker exec -i taas-es-processor_kafka /opt/kafka/bin/kafka-console-producer.sh --broker-list localhost:9092 --topic taas.workperiod.update < test/messages/taas.workperiod.update.event.json # for WorkPeriodPayment docker exec -i taas-es-processor_kafka /opt/kafka/bin/kafka-console-producer.sh --broker-list localhost:9092 --topic taas.workperiodpayment.update < test/messages/taas.workperiodpayment.update.event.json + # for Role + docker exec -i taas-es-processor_kafka /opt/kafka/bin/kafka-console-producer.sh --broker-list localhost:9092 --topic taas.role.update < test/messages/taas.role.update.event.json ``` - Run `npm run view-data ` to see if documents were updated. ## Delete documents in ES -- Run the following commands to delete `Job`, `JobCandidate`, `ResourceBooking`, `WorkPeriod` documents in ES. +- Run the following commands to delete `Job`, `JobCandidate`, `ResourceBooking`, `WorkPeriod`, `Role` documents in ES. ``` bash # for Job @@ -53,6 +57,8 @@ docker exec -i taas-es-processor_kafka /opt/kafka/bin/kafka-console-producer.sh --broker-list localhost:9092 --topic taas.resourcebooking.delete < test/messages/taas.resourcebooking.delete.event.json # for WorkPeriod docker exec -i taas-es-processor_kafka /opt/kafka/bin/kafka-console-producer.sh --broker-list localhost:9092 --topic taas.workperiod.delete < test/messages/taas.workperiod.delete.event.json + # for Role + docker exec -i taas-es-processor_kafka /opt/kafka/bin/kafka-console-producer.sh --broker-list localhost:9092 --topic taas.role.delete < test/messages/taas.role.delete.event.json ``` - Run `npm run view-data ` to see if documents were deleted. diff --git a/config/default.js b/config/default.js index 1ea7851..ffb2c16 100644 --- a/config/default.js +++ b/config/default.js @@ -38,7 +38,11 @@ module.exports = { // topics for interview service TAAS_INTERVIEW_REQUEST_TOPIC: process.env.TAAS_INTERVIEW_REQUEST_TOPIC || 'taas.interview.requested', TAAS_INTERVIEW_UPDATE_TOPIC: process.env.TAAS_INTERVIEW_UPDATE_TOPIC || 'taas.interview.update', - TAAS_INTERVIEW_BULK_UPDATE_TOPIC: process.env.TAAS_INTERVIEW_BULK_UPDATE_TOPIC || 'taas.interview.bulkUpdate' + TAAS_INTERVIEW_BULK_UPDATE_TOPIC: process.env.TAAS_INTERVIEW_BULK_UPDATE_TOPIC || 'taas.interview.bulkUpdate', + // topics for role service + TAAS_ROLE_CREATE_TOPIC: process.env.TAAS_ROLE_CREATE_TOPIC || 'taas.role.requested', + TAAS_ROLE_UPDATE_TOPIC: process.env.TAAS_ROLE_UPDATE_TOPIC || 'taas.role.update', + TAAS_ROLE_DELETE_TOPIC: process.env.TAAS_ROLE_DELETE_TOPIC || 'taas.role.delete' }, esConfig: { @@ -54,7 +58,8 @@ module.exports = { ES_INDEX_JOB: process.env.ES_INDEX_JOB || 'job', ES_INDEX_JOB_CANDIDATE: process.env.ES_INDEX_JOB_CANDIDATE || 'job_candidate', - ES_INDEX_RESOURCE_BOOKING: process.env.ES_INDEX_RESOURCE_BOOKING || 'resource_booking' + ES_INDEX_RESOURCE_BOOKING: process.env.ES_INDEX_RESOURCE_BOOKING || 'resource_booking', + ES_INDEX_ROLE: process.env.ES_INDEX_ROLE || 'role' }, auth0: { diff --git a/package-lock.json b/package-lock.json index 8db26cb..b198b5c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -3967,9 +3967,9 @@ "dev": true }, "normalize-url": { - "version": "4.5.0", - "resolved": "https://registry.npmjs.org/normalize-url/-/normalize-url-4.5.0.tgz", - "integrity": "sha512-2s47yzUxdexf1OhyRi4Em83iQk0aPvwTddtFz4hnSSw9dCEsLEGf6SwIO8ss/19S9iBb5sJaOuTvTGDeZI00BQ==", + "version": "4.5.1", + "resolved": "https://registry.npmjs.org/normalize-url/-/normalize-url-4.5.1.tgz", + "integrity": "sha512-9UZCFRHQdNrfTpGg8+1INIg93B6zE0aXMVFkw1WFwvO4SlZywU6aLg5Of0Ap/PgcbSw4LNxvMWXMeugwMCX0AA==", "dev": true }, "npm-run-path": { diff --git a/package.json b/package.json index f857c4e..7bd0c50 100644 --- a/package.json +++ b/package.json @@ -60,4 +60,4 @@ "test/e2e/*.js" ] } -} \ No newline at end of file +} diff --git a/src/app.js b/src/app.js index eb87bc9..5b403b0 100644 --- a/src/app.js +++ b/src/app.js @@ -15,6 +15,7 @@ const ResourceBookingProcessorService = require('./services/ResourceBookingProce const WorkPeriodProcessorService = require('./services/WorkPeriodProcessorService') const InterviewProcessorService = require('./services/InterviewProcessorService') const WorkPeriodPaymentProcessorService = require('./services/WorkPeriodPaymentProcessorService') +const RoleProcessorService = require('./services/RoleProcessorService') const Mutex = require('async-mutex').Mutex const events = require('events') @@ -52,7 +53,11 @@ const topicServiceMapping = { // interview [config.topics.TAAS_INTERVIEW_REQUEST_TOPIC]: InterviewProcessorService.processRequestInterview, [config.topics.TAAS_INTERVIEW_UPDATE_TOPIC]: InterviewProcessorService.processUpdateInterview, - [config.topics.TAAS_INTERVIEW_BULK_UPDATE_TOPIC]: InterviewProcessorService.processBulkUpdateInterviews + [config.topics.TAAS_INTERVIEW_BULK_UPDATE_TOPIC]: InterviewProcessorService.processBulkUpdateInterviews, + // role + [config.topics.TAAS_ROLE_CREATE_TOPIC]: RoleProcessorService.processCreate, + [config.topics.TAAS_ROLE_UPDATE_TOPIC]: RoleProcessorService.processUpdate, + [config.topics.TAAS_ROLE_DELETE_TOPIC]: RoleProcessorService.processDelete } // Start kafka consumer diff --git a/src/bootstrap.js b/src/bootstrap.js index be0d1c8..33446d1 100644 --- a/src/bootstrap.js +++ b/src/bootstrap.js @@ -12,17 +12,18 @@ global.Promise = require('bluebird') Joi.rateType = () => Joi.string().valid('hourly', 'daily', 'weekly', 'monthly') Joi.jobStatus = () => Joi.string().valid('sourcing', 'in-review', 'assigned', 'closed', 'cancelled') Joi.resourceBookingStatus = () => Joi.string().valid('placed', 'closed', 'cancelled') -Joi.jobCandidateStatus = () => Joi.string().valid('open', 'placed', 'selected', 'client rejected - screening', 'client rejected - interview', 'rejected - other', 'cancelled', 'interview', 'topcoder-rejected','applied','rejected-pre-screen','skills-test','skills-test','phone-screen','job-closed') +Joi.jobCandidateStatus = () => Joi.string().valid('open', 'placed', 'selected', 'client rejected - screening', 'client rejected - interview', 'rejected - other', 'cancelled', 'interview', 'topcoder-rejected', 'applied', 'rejected-pre-screen', 'skills-test', 'skills-test', 'phone-screen', 'job-closed', 'offered') Joi.workload = () => Joi.string().valid('full-time', 'fractional') Joi.title = () => Joi.string().max(128) Joi.paymentStatus = () => Joi.string().valid('pending', 'partially-completed', 'completed', 'cancelled') Joi.xaiTemplate = () => Joi.string().valid(...allowedXAITemplates) Joi.interviewStatus = () => Joi.string().valid(...allowedInterviewStatuses) -Joi.workPeriodPaymentStatus = () => Joi.string().valid('completed', 'cancelled') +Joi.workPeriodPaymentStatus = () => Joi.string().valid('completed', 'scheduled', 'in-progress', 'failed', 'cancelled') // Empty string is not allowed by Joi by default and must be enabled with allow(''). // See https://joi.dev/api/?v=17.3.0#string fro details why it's like this. // In many cases we would like to allow empty string to make it easier to create UI for editing data. Joi.stringAllowEmpty = () => Joi.string().allow('') +Joi.smallint = () => Joi.number().min(-32768).max(32767) const zapierSwitch = Joi.string().label('ZAPIER_SWITCH').valid(...Object.values(constants.Zapier.Switch)) diff --git a/src/scripts/createIndex.js b/src/scripts/createIndex.js index aae5c10..8051f5d 100644 --- a/src/scripts/createIndex.js +++ b/src/scripts/createIndex.js @@ -26,8 +26,16 @@ async function createIndex () { rateType: { type: 'keyword' }, workload: { type: 'keyword' }, skills: { type: 'keyword' }, + roles: { type: 'keyword' }, status: { type: 'keyword' }, isApplicationPageActive: { type: 'boolean' }, + minSalary: { type: 'integer' }, + maxSalary: { type: 'integer' }, + hoursPerWeek: { type: 'integer' }, + jobLocation: { type: 'keyword' }, + jobTimezone: { type: 'keyword' }, + currency: { type: 'keyword' }, + roleIds: { type: 'keyword' }, createdAt: { type: 'date' }, createdBy: { type: 'keyword' }, updatedAt: { type: 'date' }, @@ -46,6 +54,7 @@ async function createIndex () { status: { type: 'keyword' }, externalId: { type: 'keyword' }, resume: { type: 'text' }, + remark: { type: 'keyword' }, interviews: { type: 'nested', properties: { @@ -103,7 +112,8 @@ async function createIndex () { properties: { id: { type: 'keyword' }, resourceBookingId: { type: 'keyword' }, - userHandle: { type: 'keyword' }, + userHandle: { type: 'keyword', + normalizer: 'lowercaseNormalizer' }, projectId: { type: 'integer' }, userId: { type: 'keyword' }, startDate: { type: 'date', format: 'yyyy-MM-dd' }, @@ -120,6 +130,16 @@ async function createIndex () { challengeId: { type: 'keyword' }, amount: { type: 'float' }, status: { type: 'keyword' }, + statusDetails: { + type: 'nested', + properties: { + errorMessage: { type: 'text' }, + errorCode: { type: 'integer' }, + retry: { type: 'integer' }, + step: { type: 'keyword' }, + challengeId: { type: 'keyword' } + } + }, billingAccountId: { type: 'integer' }, createdAt: { type: 'date' }, createdBy: { type: 'keyword' }, @@ -140,11 +160,66 @@ async function createIndex () { } } } + }, + { index: config.get('esConfig.ES_INDEX_ROLE'), + body: { + mappings: { + properties: { + name: { type: 'keyword' }, + description: { type: 'keyword' }, + listOfSkills: { type: 'keyword' }, + rates: { + properties: { + global: { type: 'integer' }, + inCountry: { type: 'integer' }, + offShore: { type: 'integer' }, + rate30Global: { type: 'integer' }, + rate30InCountry: { type: 'integer' }, + rate30OffShore: { type: 'integer' }, + rate20Global: { type: 'integer' }, + rate20InCountry: { type: 'integer' }, + rate20OffShore: { type: 'integer' } + } + }, + numberOfMembers: { type: 'integer' }, + numberOfMembersAvailable: { type: 'integer' }, + imageUrl: { type: 'keyword' }, + timeToCandidate: { type: 'integer' }, + timeToInterview: { type: 'integer' }, + createdAt: { type: 'date' }, + createdBy: { type: 'keyword' }, + updatedAt: { type: 'date' }, + updatedBy: { type: 'keyword' } + } + } + } } ] for (const index of indices) { - await esClient.indices.create(index) + await esClient.indices.create({ index: index.index }) + await esClient.indices.close({ index: index.index }) + await esClient.indices.putSettings({ + index: index.index, + body: { + settings: { + analysis: { + normalizer: { + lowercaseNormalizer: { + filter: ['lowercase'] + } + } + } + } + } + }) + await esClient.indices.open({ index: index.index }) + await esClient.indices.putMapping({ + index: index.index, + body: { + properties: index.body.mappings.properties + } + }) logger.info({ component: 'createIndex', message: `ES Index ${index.index} creation succeeded!` }) } process.exit(0) diff --git a/src/scripts/deleteIndex.js b/src/scripts/deleteIndex.js index 9c3a1bb..84e15bc 100644 --- a/src/scripts/deleteIndex.js +++ b/src/scripts/deleteIndex.js @@ -11,7 +11,8 @@ async function deleteIndex () { const esClient = helper.getESClient() const indices = [config.get('esConfig.ES_INDEX_JOB'), config.get('esConfig.ES_INDEX_JOB_CANDIDATE'), - config.get('esConfig.ES_INDEX_RESOURCE_BOOKING')] + config.get('esConfig.ES_INDEX_RESOURCE_BOOKING'), + config.get('esConfig.ES_INDEX_ROLE')] for (const index of indices) { await esClient.indices.delete({ index diff --git a/src/scripts/view-data.js b/src/scripts/view-data.js index 1db36d5..c422c0c 100644 --- a/src/scripts/view-data.js +++ b/src/scripts/view-data.js @@ -11,7 +11,8 @@ const esClient = helper.getESClient() const modelIndexMapping = { Job: 'ES_INDEX_JOB', JobCandidate: 'ES_INDEX_JOB_CANDIDATE', - ResourceBooking: 'ES_INDEX_RESOURCE_BOOKING' + ResourceBooking: 'ES_INDEX_RESOURCE_BOOKING', + Role: 'ES_INDEX_ROLE' } async function showESData () { diff --git a/src/services/JobCandidateProcessorService.js b/src/services/JobCandidateProcessorService.js index 48d8660..bde7e88 100644 --- a/src/services/JobCandidateProcessorService.js +++ b/src/services/JobCandidateProcessorService.js @@ -101,7 +101,8 @@ processCreate.schema = { updatedBy: Joi.string().uuid().allow(null), status: Joi.jobCandidateStatus().required(), externalId: Joi.string().allow(null), - resume: Joi.string().uri().allow(null) + resume: Joi.string().uri().allow(null), + remark: Joi.string().allow(null) }).required() }).required(), transactionId: Joi.string().required() diff --git a/src/services/JobProcessorService.js b/src/services/JobProcessorService.js index 678a3c3..08f5525 100644 --- a/src/services/JobProcessorService.js +++ b/src/services/JobProcessorService.js @@ -78,12 +78,20 @@ processCreate.schema = { rateType: Joi.rateType().allow(null), workload: Joi.workload().allow(null), skills: Joi.array().items(Joi.string().uuid()).required(), + roles: Joi.array().items(Joi.string().uuid()).allow(null), createdAt: Joi.date().required(), createdBy: Joi.string().uuid().required(), updatedAt: Joi.date().allow(null), updatedBy: Joi.string().uuid().allow(null), status: Joi.jobStatus().required(), - isApplicationPageActive: Joi.boolean().required() + isApplicationPageActive: Joi.boolean().required(), + minSalary: Joi.number().integer().allow(null), + maxSalary: Joi.number().integer().allow(null), + hoursPerWeek: Joi.number().integer().allow(null), + jobLocation: Joi.string().allow(null), + jobTimezone: Joi.string().allow(null), + currency: Joi.string().allow(null), + roleIds: Joi.array().items(Joi.string().uuid().required()).allow(null) }).required() }).required(), transactionId: Joi.string().required() diff --git a/src/services/RoleProcessorService.js b/src/services/RoleProcessorService.js new file mode 100644 index 0000000..cf1386f --- /dev/null +++ b/src/services/RoleProcessorService.js @@ -0,0 +1,119 @@ +/** + * Role Processor Service + */ + +const Joi = require('@hapi/joi') +const logger = require('../common/logger') +const helper = require('../common/helper') +const constants = require('../common/constants') +const config = require('config') + +const esClient = helper.getESClient() + +/** + * Process create entity message + * @param {Object} message the kafka message + * @param {String} transactionId + */ +async function processCreate (message, transactionId) { + const role = message.payload + await esClient.createExtra({ + index: config.get('esConfig.ES_INDEX_ROLE'), + id: role.id, + transactionId, + body: role, + refresh: constants.esRefreshOption + }) +} + +processCreate.schema = { + message: Joi.object().keys({ + topic: Joi.string().required(), + originator: Joi.string().required(), + timestamp: Joi.date().required(), + 'mime-type': Joi.string().required(), + payload: Joi.object().keys({ + id: Joi.string().uuid().required(), + name: Joi.string().max(50).required(), + description: Joi.string().max(1000).allow(null), + listOfSkills: Joi.array().items(Joi.string().max(50).required()).allow(null), + rates: Joi.array().items(Joi.object().keys({ + global: Joi.smallint().required(), + inCountry: Joi.smallint().required(), + offShore: Joi.smallint().required(), + rate30Global: Joi.smallint().allow(null), + rate30InCountry: Joi.smallint().allow(null), + rate30OffShore: Joi.smallint().allow(null), + rate20Global: Joi.smallint().allow(null), + rate20InCountry: Joi.smallint().allow(null), + rate20OffShore: Joi.smallint().allow(null) + }).required()).required(), + numberOfMembers: Joi.number().allow(null), + numberOfMembersAvailable: Joi.smallint().allow(null), + imageUrl: Joi.string().uri().max(255).allow(null), + timeToCandidate: Joi.smallint().allow(null), + timeToInterview: Joi.smallint().allow(null), + createdAt: Joi.date().required(), + createdBy: Joi.string().uuid().required(), + updatedAt: Joi.date().allow(null), + updatedBy: Joi.string().uuid().allow(null) + }).required() + }).required(), + transactionId: Joi.string().required() +} + +/** + * Process update entity message + * @param {Object} message the kafka message + * @param {String} transactionId + */ +async function processUpdate (message, transactionId) { + const data = message.payload + await esClient.updateExtra({ + index: config.get('esConfig.ES_INDEX_ROLE'), + id: data.id, + transactionId, + body: { + doc: data + }, + refresh: constants.esRefreshOption + }) +} + +processUpdate.schema = processCreate.schema + +/** + * Process delete entity message + * @param {Object} message the kafka message + * @param {String} transactionId + */ +async function processDelete (message, transactionId) { + const id = message.payload.id + await esClient.deleteExtra({ + index: config.get('esConfig.ES_INDEX_ROLE'), + id, + transactionId, + refresh: constants.esRefreshOption + }) +} + +processDelete.schema = { + message: Joi.object().keys({ + topic: Joi.string().required(), + originator: Joi.string().required(), + timestamp: Joi.date().required(), + 'mime-type': Joi.string().required(), + payload: Joi.object().keys({ + id: Joi.string().uuid().required() + }).required() + }).required(), + transactionId: Joi.string().required() +} + +module.exports = { + processCreate, + processUpdate, + processDelete +} + +logger.buildService(module.exports, 'RoleProcessorService') diff --git a/src/services/WorkPeriodPaymentProcessorService.js b/src/services/WorkPeriodPaymentProcessorService.js index 7f30b6e..a168ded 100644 --- a/src/services/WorkPeriodPaymentProcessorService.js +++ b/src/services/WorkPeriodPaymentProcessorService.js @@ -65,10 +65,17 @@ processCreate.schema = { payload: Joi.object().keys({ id: Joi.string().uuid().required(), workPeriodId: Joi.string().uuid().required(), - challengeId: Joi.string().uuid().required(), + challengeId: Joi.string().uuid().allow(null), amount: Joi.number().greater(0).allow(null), status: Joi.workPeriodPaymentStatus().required(), billingAccountId: Joi.number().allow(null), + statusDetails: Joi.object().keys({ + errorMessage: Joi.string().required(), + errorCode: Joi.number().integer().allow(null), + retry: Joi.number().integer().allow(null), + step: Joi.string().allow(null), + challengeId: Joi.string().uuid().allow(null) + }).unknown(true).allow(null), createdAt: Joi.date().required(), createdBy: Joi.string().uuid().required(), updatedAt: Joi.date().allow(null), diff --git a/test/common/testData.js b/test/common/testData.js index e583618..47a0dd1 100644 --- a/test/common/testData.js +++ b/test/common/testData.js @@ -26,6 +26,11 @@ const messages = { create: { topic: 'taas.workperiodpayment.create', message: require('../messages/taas.workperiodpayment.create.event.json') }, update: { topic: 'taas.workperiodpayment.update', message: require('../messages/taas.workperiodpayment.update.event.json') } }, + Role: { + create: { topic: 'taas.role.requested', message: require('../messages/taas.role.create.event.json') }, + update: { topic: 'taas.role.update', message: require('../messages/taas.role.update.event.json') }, + delete: { topic: 'taas.role.delete', message: require('../messages/taas.role.delete.event .json') } + }, messageInvalid: '{ "topic": "taas.job.create", }' } diff --git a/test/common/testHelper.js b/test/common/testHelper.js index fd310d8..6410492 100644 --- a/test/common/testHelper.js +++ b/test/common/testHelper.js @@ -40,7 +40,8 @@ async function clearES () { query: { match_all: {} } - } + }, + refresh: true }) } } diff --git a/test/messages/taas.job.create.event.json b/test/messages/taas.job.create.event.json index ebc5d15..0813259 100644 --- a/test/messages/taas.job.create.event.json +++ b/test/messages/taas.job.create.event.json @@ -24,6 +24,15 @@ "createdAt": "2020-11-05T19:00:16.268Z", "createdBy": "a55fe1bc-1754-45fa-9adc-cf3d6d7c377a", "status": "sourcing", - "isApplicationPageActive": false + "isApplicationPageActive": false, + "minSalary": 100, + "maxSalary": 200, + "hoursPerWeek": 20, + "jobLocation": "Any location", + "jobTimezone": "GMT", + "currency": "USD", + "roleIds": [ + "e7b7e818-40d4-4102-b486-09bdd21400b8" + ] } } \ No newline at end of file diff --git a/test/messages/taas.job.update.event.json b/test/messages/taas.job.update.event.json index 3be8597..56a7b0d 100644 --- a/test/messages/taas.job.update.event.json +++ b/test/messages/taas.job.update.event.json @@ -23,6 +23,15 @@ "updatedBy": "a55fe1bc-1754-45fa-9adc-cf3d6d7c377a", "createdAt": "2020-11-05T19:00:16.268Z", "createdBy": "a55fe1bc-1754-45fa-9adc-cf3d6d7c377a", - "isApplicationPageActive": false + "isApplicationPageActive": false, + "minSalary": 100, + "maxSalary": 200, + "hoursPerWeek": 20, + "jobLocation": "Any location", + "jobTimezone": "GMT", + "currency": "USD", + "roleIds": [ + "e7b7e818-40d4-4102-b486-09bdd21400b8" + ] } } \ No newline at end of file diff --git a/test/messages/taas.jobcandidate.create.event.json b/test/messages/taas.jobcandidate.create.event.json index 822dc80..28ba870 100644 --- a/test/messages/taas.jobcandidate.create.event.json +++ b/test/messages/taas.jobcandidate.create.event.json @@ -9,6 +9,7 @@ "id": "0cb99adb-8bcd-4952-9203-9867dd45ef6f", "createdAt": "2020-11-05T19:00:19.052Z", "createdBy": "a55fe1bc-1754-45fa-9adc-cf3d6d7c377a", - "status": "open" + "status": "open", + "remark": "excellent" } } \ No newline at end of file diff --git a/test/messages/taas.jobcandidate.update.event.json b/test/messages/taas.jobcandidate.update.event.json index 1254087..cc6e506 100644 --- a/test/messages/taas.jobcandidate.update.event.json +++ b/test/messages/taas.jobcandidate.update.event.json @@ -8,6 +8,7 @@ "jobId": "ffbc24f7-301e-48d3-bf01-c056916056a2", "userId": "a55fe1bc-1754-45fa-9adc-cf3d6d7c377a", "status": "selected", + "remark": "excellent", "updatedAt": "2020-11-05T19:00:21.625Z", "updatedBy": "a55fe1bc-1754-45fa-9adc-cf3d6d7c377a", "createdAt": "2020-11-05T19:00:16.268Z", diff --git a/test/messages/taas.role.create.event.json b/test/messages/taas.role.create.event.json new file mode 100644 index 0000000..a45b6a8 --- /dev/null +++ b/test/messages/taas.role.create.event.json @@ -0,0 +1,50 @@ +{ + "topic": "taas.role.requested", + "originator": "taas-api", + "timestamp": "2021-05-27T21:43:09.388Z", + "mime-type": "application/json", + "payload": { + "name": "Salesforce Developer", + "description": "A Salesforce developer is a programmer who builds Salesforce applications across various PaaS (Platform as a Service) platforms.", + "listOfSkills": [ + "Docker", + ".NET", + "appcelerator", + "Flux" + ], + "rates": [ + { + "global": 50, + "inCountry": 20, + "offShore": 10, + "rate30Global": 20, + "rate30InCountry": 15, + "rate30OffShore": 35, + "rate20Global": 20, + "rate20InCountry": 15, + "rate20OffShore": 35 + }, + { + "global": 25, + "inCountry": 15, + "offShore": 5, + "rate30Global": 20, + "rate30InCountry": 15, + "rate30OffShore": 35, + "rate20Global": 20, + "rate20InCountry": 15, + "rate20OffShore": 35 + } + ], + "numberOfMembers": 10, + "numberOfMembersAvailable": 6, + "imageUrl": "http: //images.topcoder.com/member", + "timeToCandidate": 105, + "timeToInterview": 100, + "id": "e7b7e818-40d4-4102-b486-09bdd21400b8", + "createdBy": "00000000-0000-0000-0000-000000000000", + "updatedAt": "2021-05-27T21:43:09.342Z", + "createdAt": "2021-05-27T21:43:09.342Z", + "updatedBy": null + } +} \ No newline at end of file diff --git a/test/messages/taas.role.delete.event .json b/test/messages/taas.role.delete.event .json new file mode 100644 index 0000000..3bd7c32 --- /dev/null +++ b/test/messages/taas.role.delete.event .json @@ -0,0 +1,9 @@ +{ + "topic": "taas.role.delete", + "originator": "taas-api", + "timestamp": "2021-05-27T21:45:09.388Z", + "mime-type": "application/json", + "payload": { + "id": "e7b7e818-40d4-4102-b486-09bdd21400b8" + } +} \ No newline at end of file diff --git a/test/messages/taas.role.update.event.json b/test/messages/taas.role.update.event.json new file mode 100644 index 0000000..5c2a482 --- /dev/null +++ b/test/messages/taas.role.update.event.json @@ -0,0 +1,48 @@ +{ + "topic": "taas.role.update", + "originator": "taas-api", + "timestamp": "2021-05-27T21:44:09.388Z", + "mime-type": "application/json", + "payload": { + "name": "Salesforce Developer", + "description": "A Salesforce developer is a programmer who builds Salesforce applications across various PaaS (Platform as a Service) platforms.", + "listOfSkills": [ + "Docker", + ".NET" + ], + "rates": [ + { + "global": 50, + "inCountry": 20, + "offShore": 10, + "rate30Global": 20, + "rate30InCountry": 15, + "rate30OffShore": 35, + "rate20Global": 20, + "rate20InCountry": 15, + "rate20OffShore": 35 + }, + { + "global": 25, + "inCountry": 15, + "offShore": 5, + "rate30Global": 20, + "rate30InCountry": 15, + "rate30OffShore": 35, + "rate20Global": 20, + "rate20InCountry": 15, + "rate20OffShore": 35 + } + ], + "numberOfMembers": 10, + "numberOfMembersAvailable": 6, + "imageUrl": "http: //images.topcoder.com/member", + "timeToCandidate": 105, + "timeToInterview": 100, + "id": "e7b7e818-40d4-4102-b486-09bdd21400b8", + "createdBy": "00000000-0000-0000-0000-000000000000", + "updatedAt": "2021-05-27T21:43:09.342Z", + "createdAt": "2021-05-27T21:43:09.342Z", + "updatedBy": "00000000-0000-0000-0000-000000000000" + } +} \ No newline at end of file