Skip to content

Commit 59c6e41

Browse files
authored
Merge pull request #280 from topcoder-platform/feature/role-intake
Feature/role intake
2 parents f1ea6f8 + b880eaa commit 59c6e41

File tree

2 files changed

+9
-20
lines changed

2 files changed

+9
-20
lines changed

data/demo-data.json

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -708,9 +708,6 @@
708708
"id": "077aa2ca-5b60-4ad9-a965-1b37e08a5046",
709709
"xaiId": null,
710710
"jobCandidateId": "881a19de-2b0c-4bb9-b36a-4cb5e223bdb5",
711-
"googleCalendarId": null,
712-
"customMessage": null,
713-
"templateUrl": "interview-30",
714711
"calendarEventId": null,
715712
"templateUrl": "interview-30",
716713
"templateId": null,
@@ -752,9 +749,6 @@
752749
"id": "b1f7ba76-640f-47e2-9463-59e51b51ec60",
753750
"xaiId": null,
754751
"jobCandidateId": "827ee401-df04-42e1-abbe-7b97ce7937ff",
755-
"googleCalendarId": "dummyId",
756-
"customMessage": "This is a custom message",
757-
"templateUrl": "interview-30",
758752
"calendarEventId": null,
759753
"templateUrl": "interview-30",
760754
"templateId": null,
@@ -781,9 +775,6 @@
781775
"id": "3144fa65-ea1a-4bec-81b0-7cb1c8845826",
782776
"xaiId": null,
783777
"jobCandidateId": "827ee401-df04-42e1-abbe-7b97ce7937ff",
784-
"googleCalendarId": null,
785-
"customMessage": null,
786-
"templateUrl": "interview-30",
787778
"calendarEventId": null,
788779
"templateUrl": "interview-30",
789780
"templateId": null,
@@ -825,9 +816,6 @@
825816
"id": "976d23a9-5710-453f-99d9-f57a588bb610",
826817
"xaiId": null,
827818
"jobCandidateId": "a4ea7bcf-5b99-4381-b99c-a9bd05d83a36",
828-
"googleCalendarId": "dummyId",
829-
"customMessage": "This is a custom message",
830-
"templateUrl": "interview-30",
831819
"calendarEventId": null,
832820
"templateUrl": "interview-30",
833821
"templateId": null,
@@ -854,9 +842,6 @@
854842
"id": "a23e1bf2-1084-4cfe-a0d8-d83bc6fec655",
855843
"xaiId": null,
856844
"jobCandidateId": "a4ea7bcf-5b99-4381-b99c-a9bd05d83a36",
857-
"googleCalendarId": "dummyId",
858-
"customMessage": "This is a custom message",
859-
"templateUrl": "interview-30",
860845
"calendarEventId": null,
861846
"templateUrl": "interview-30",
862847
"templateId": null,
@@ -883,9 +868,6 @@
883868
"id": "9efd72c3-1dc7-4ce2-9869-8cca81d0adeb",
884869
"xaiId": null,
885870
"jobCandidateId": "a4ea7bcf-5b99-4381-b99c-a9bd05d83a36",
886-
"googleCalendarId": null,
887-
"customMessage": null,
888-
"templateUrl": "interview-30",
889871
"calendarEventId": null,
890872
"templateUrl": "interview-30",
891873
"templateId": null,

src/services/JobService.js

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -411,6 +411,7 @@ async function searchJobs (currentUser, criteria, options = { returnAll: false }
411411
'startDate',
412412
'resourceType',
413413
'skill',
414+
'role',
414415
'rateType',
415416
'workload',
416417
'title',
@@ -425,10 +426,10 @@ async function searchJobs (currentUser, criteria, options = { returnAll: false }
425426
}
426427
}
427428
}
428-
} else if (key === 'skill') {
429+
} else if (key === 'skill' || key === 'role') {
429430
must = {
430431
terms: {
431-
skills: [value]
432+
[`${key}s`]: [value]
432433
}
433434
}
434435
} else {
@@ -508,6 +509,11 @@ async function searchJobs (currentUser, criteria, options = { returnAll: false }
508509
[Op.contains]: [criteria.skill]
509510
}
510511
}
512+
if (criteria.role) {
513+
filter.roles = {
514+
[Op.contains]: [criteria.role]
515+
}
516+
}
511517
if (criteria.jobIds && criteria.jobIds.length > 0) {
512518
filter[Op.and].push({ id: criteria.jobIds })
513519
}
@@ -545,6 +551,7 @@ searchJobs.schema = Joi.object().keys({
545551
startDate: Joi.date(),
546552
resourceType: Joi.string(),
547553
skill: Joi.string().uuid(),
554+
role: Joi.string().uuid(),
548555
rateType: Joi.rateType(),
549556
workload: Joi.workload(),
550557
status: Joi.jobStatus(),

0 commit comments

Comments
 (0)