Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
6d1b0df
work period endpoint
eisbilir Mar 30, 2021
830de0e
Merge pull request #30 from eisbilir/challenge-work-period
maxceem Apr 4, 2021
9f90675
Merge pull request #31 from topcoder-platform/feature/work-periods
nkumar-topcoder Apr 5, 2021
6c384ae
fix: update JC in Zapier only when status changed
maxceem Apr 8, 2021
70dc182
fix: e2e and unite tests
maxceem Apr 8, 2021
0b83623
Merge pull request #33 from topcoder-platform/hotfix/patch-1.5.3.1
nkumar-topcoder Apr 9, 2021
c7a55dc
feat: add JC status "topcoder-rejected"
maxceem Apr 9, 2021
f34e1a7
Merge pull request #35 from topcoder-platform/hotfix/patch-1.5.3.1
nkumar-topcoder Apr 9, 2021
9a42597
Add work period payments.
narekcat Apr 9, 2021
1012957
resource booking status fixed
eisbilir Apr 14, 2021
556d5e3
Merge pull request #36 from eisbilir/work-period-automation
maxceem Apr 15, 2021
4217172
Merge branch 'dev' into feature/work-periods-automation
maxceem Apr 15, 2021
977c174
Merge pull request #37 from topcoder-platform/feature/work-periods-au…
maxceem Apr 16, 2021
4c5d45c
Merge pull request #39 from narekcat/feature/work-periods
maxceem Apr 17, 2021
af161b9
Merge branch 'dev' into feature/work-periods
maxceem Apr 17, 2021
e965836
fix: unit test
maxceem Apr 17, 2021
c966138
Final fixes for adding work period payments.
narekcat Apr 18, 2021
cd4ccbc
Merge pull request #41 from narekcat/feature/work-periods
maxceem Apr 19, 2021
c76d6a3
Merge pull request #42 from topcoder-platform/feature/work-periods
nkumar-topcoder Apr 19, 2021
130d37a
part1
xxcxy Apr 21, 2021
47ae415
part2
xxcxy Apr 21, 2021
36fa12d
Merge pull request #43 from xxcxy/feature/interview-scheduler
urwithat Apr 21, 2021
47b825c
Merge branch 'dev' into feature/interview-scheduler
urwithat Apr 21, 2021
e10f939
Merge pull request #44 from topcoder-platform/feature/interview-sched…
urwithat Apr 21, 2021
4a6b647
Revert "Feature/interview scheduler"
nkumar-topcoder Apr 21, 2021
9761368
Merge pull request #45 from topcoder-platform/revert-44-feature/inter…
nkumar-topcoder Apr 21, 2021
6872051
Resource Booking index to not store time, only dates
eisbilir Apr 21, 2021
e7c3c6b
fix comment
eisbilir Apr 21, 2021
96ef522
Merge pull request #46 from eisbilir/dev
nkumar-topcoder Apr 22, 2021
2665ac5
Use billing account for payments
imcaizheng Apr 22, 2021
95800c8
Merge pull request #48 from imcaizheng/feature/use-billing-account-fo…
nkumar-topcoder Apr 22, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@ coverage
.DS_Store
.env
api.env
.eslintrc.y*ml
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,11 @@ The following parameters can be set in config files or in env variables:
- `topics.TAAS_RESOURCE_BOOKING_CREATE_TOPIC`: the create resource booking entity Kafka message topic
- `topics.TAAS_RESOURCE_BOOKING_UPDATE_TOPIC`: the update resource booking entity Kafka message topic
- `topics.TAAS_RESOURCE_BOOKING_DELETE_TOPIC`: the delete resource booking entity Kafka message topic
- `topics.TAAS_WORK_PERIOD_CREATE_TOPIC`: the create work period entity Kafka message topic
- `topics.TAAS_WORK_PERIOD_UPDATE_TOPIC`: the update work period entity Kafka message topic
- `topics.TAAS_WORK_PERIOD_DELETE_TOPIC`: the delete work period entity Kafka message topic
- `topics.TAAS_WORK_PERIOD_PAYMENT_CREATE_TOPIC`: the create work period payment entity Kafka message topic
- `topics.TAAS_WORK_PERIOD_PAYMENT_UPDATE_TOPIC`: the update work period payment 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
Expand All @@ -38,6 +43,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_WORK_PERIOD`: the index name for work period

- `auth0.AUTH0_URL`: Auth0 URL, used to get TC M2M token
- `auth0.AUTH0_AUDIENCE`: Auth0 audience, used to get TC M2M token
Expand Down
16 changes: 13 additions & 3 deletions VERIFICATION.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

## Create documents in ES

- Run the following commands to create `Job`, `JobCandidate` and `ResourceBooking` documents in ES.
- Run the following commands to create `Job`, `JobCandidate`, `ResourceBooking`, `WorkPeriod`, `WorkPeriodPayment` documents in ES.

``` bash
# for Job
Expand All @@ -11,12 +11,16 @@
docker exec -i taas-es-processor_kafka /opt/kafka/bin/kafka-console-producer.sh --broker-list localhost:9092 --topic taas.jobcandidate.create < test/messages/taas.jobcandidate.create.event.json
# for ResourceBooking
docker exec -i taas-es-processor_kafka /opt/kafka/bin/kafka-console-producer.sh --broker-list localhost:9092 --topic taas.resourcebooking.create < test/messages/taas.resourcebooking.create.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.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
```

- Run `npm run view-data <model-name-here>` to see if documents were created.

## Update documents in ES
- Run the following commands to update `Job`, `JobCandidate` and `ResourceBooking` documents in ES.
- Run the following commands to update `Job`, `JobCandidate`, `ResourceBooking`, `WorkPeriod`, `WorkPeriodPayment` documents in ES.

``` bash
# for Job
Expand All @@ -25,12 +29,16 @@
docker exec -i taas-es-processor_kafka /opt/kafka/bin/kafka-console-producer.sh --broker-list localhost:9092 --topic taas.jobcandidate.update < test/messages/taas.jobcandidate.update.event.json
# for ResourceBooking
docker exec -i taas-es-processor_kafka /opt/kafka/bin/kafka-console-producer.sh --broker-list localhost:9092 --topic taas.resourcebooking.update < test/messages/taas.resourcebooking.update.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.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
```

- Run `npm run view-data <model-name-here>` to see if documents were updated.

## Delete documents in ES
- Run the following commands to delete `Job`, `JobCandidate` and `ResourceBooking` documents in ES.
- Run the following commands to delete `Job`, `JobCandidate`, `ResourceBooking`, `WorkPeriod` documents in ES.

``` bash
# for Job
Expand All @@ -39,6 +47,8 @@
docker exec -i taas-es-processor_kafka /opt/kafka/bin/kafka-console-producer.sh --broker-list localhost:9092 --topic taas.jobcandidate.delete < test/messages/taas.jobcandidate.delete.event.json
# for ResourceBooking
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
```

- Run `npm run view-data <model-name-here>` to see if documents were deleted.
15 changes: 12 additions & 3 deletions config/default.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,25 @@ module.exports = {
KAFKA_GROUP_ID: process.env.KAFKA_GROUP_ID || 'taas-es-processor',

topics: {
// topics for job service
TAAS_JOB_CREATE_TOPIC: process.env.TAAS_JOB_CREATE_TOPIC || 'taas.job.create',
TAAS_JOB_UPDATE_TOPIC: process.env.TAAS_JOB_UPDATE_TOPIC || 'taas.job.update',
TAAS_JOB_DELETE_TOPIC: process.env.TAAS_JOB_DELETE_TOPIC || 'taas.job.delete',
// topics for jobcandidate service
TAAS_JOB_CANDIDATE_CREATE_TOPIC: process.env.TAAS_JOB_CANDIDATE_CREATE_TOPIC || 'taas.jobcandidate.create',
TAAS_JOB_CANDIDATE_UPDATE_TOPIC: process.env.TAAS_JOB_CANDIDATE_UPDATE_TOPIC || 'taas.jobcandidate.update',
TAAS_JOB_CANDIDATE_DELETE_TOPIC: process.env.TAAS_JOB_CANDIDATE_DELETE_TOPIC || 'taas.jobcandidate.delete',
// topics for job service
// topics for resource booking service
TAAS_RESOURCE_BOOKING_CREATE_TOPIC: process.env.TAAS_RESOURCE_BOOKING_CREATE_TOPIC || 'taas.resourcebooking.create',
TAAS_RESOURCE_BOOKING_UPDATE_TOPIC: process.env.TAAS_RESOURCE_BOOKING_UPDATE_TOPIC || 'taas.resourcebooking.update',
TAAS_RESOURCE_BOOKING_DELETE_TOPIC: process.env.TAAS_RESOURCE_BOOKING_DELETE_TOPIC || 'taas.resourcebooking.delete'
TAAS_RESOURCE_BOOKING_DELETE_TOPIC: process.env.TAAS_RESOURCE_BOOKING_DELETE_TOPIC || 'taas.resourcebooking.delete',
// topics for work period service
TAAS_WORK_PERIOD_CREATE_TOPIC: process.env.TAAS_WORK_PERIOD_CREATE_TOPIC || 'taas.workperiod.create',
TAAS_WORK_PERIOD_UPDATE_TOPIC: process.env.TAAS_WORK_PERIOD_UPDATE_TOPIC || 'taas.workperiod.update',
TAAS_WORK_PERIOD_DELETE_TOPIC: process.env.TAAS_WORK_PERIOD_DELETE_TOPIC || 'taas.workperiod.delete',
// topics for work period payment service
TAAS_WORK_PERIOD_PAYMENT_CREATE_TOPIC: process.env.TAAS_WORK_PERIOD_PAYMENT_CREATE_TOPIC || 'taas.workperiodpayment.create',
TAAS_WORK_PERIOD_PAYMENT_UPDATE_TOPIC: process.env.TAAS_WORK_PERIOD_PAYMENT_UPDATE_TOPIC || 'taas.workperiodpayment.update'
},

esConfig: {
Expand All @@ -42,7 +50,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_WORK_PERIOD: process.env.ES_INDEX_WORK_PERIOD || 'work_period'
},

auth0: {
Expand Down
10 changes: 10 additions & 0 deletions config/test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
/**
* The default configuration file.
*/

module.exports = {
zapier: {
ZAPIER_SWITCH: process.env.ZAPIER_SWITCH || 'ON',
ZAPIER_JOB_CANDIDATE_SWITCH: process.env.ZAPIER_JOB_CANDIDATE_SWITCH || 'ON'
}
}
2 changes: 1 addition & 1 deletion local/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ services:
- "9092:9092"
environment:
KAFKA_ADVERTISED_HOST_NAME: localhost
KAFKA_CREATE_TOPICS: "taas.job.create:1:1,taas.jobcandidate.create:1:1,taas.resourcebooking.create:1:1,taas.job.update:1:1,taas.jobcandidate.update:1:1,taas.resourcebooking.update:1:1,taas.job.delete:1:1,taas.jobcandidate.delete:1:1,taas.resourcebooking.delete:1:1"
KAFKA_CREATE_TOPICS: "taas.job.create:1:1,taas.jobcandidate.create:1:1,taas.resourcebooking.create:1:1,taas.workperiod.create:1:1,taas.workperiodpayment.create:1:1,taas.job.update:1:1,taas.jobcandidate.update:1:1,taas.resourcebooking.update:1:1,taas.workperiod.update:1:1,taas.workperiodpayment.update:1:1,taas.job.delete:1:1,taas.jobcandidate.delete:1:1,taas.resourcebooking.delete:1:1,taas.workperiod.delete:1:1"
KAFKA_ZOOKEEPER_CONNECT: zookeeper:2181
esearch:
image: elasticsearch:7.7.1
Expand Down
181 changes: 181 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 6 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,21 @@
"create-index": "node src/scripts/createIndex.js",
"delete-index": "node src/scripts/deleteIndex.js",
"view-data": "node src/scripts/view-data.js",
"test": "mocha test/unit/test.js --require test/unit/prepare.js --timeout 20000 --exit",
"test:cov": "nyc --reporter=html --reporter=text mocha test/unit/test.js --require test/unit/prepare.js --timeout 20000 --exit",
"e2e": "mocha test/e2e/test.js --timeout 20000 --exit",
"e2e:cov": "nyc --reporter=html --reporter=text mocha test/e2e/test.js --timeout 20000 --exit"
"test": "cross-env NODE_ENV=test mocha test/unit/test.js --require test/unit/prepare.js --timeout 20000 --exit",
"test:cov": "cross-env NODE_ENV=test nyc --reporter=html --reporter=text mocha test/unit/test.js --require test/unit/prepare.js --timeout 20000 --exit",
"e2e": "cross-env NODE_ENV=test mocha test/e2e/test.js --timeout 20000 --exit",
"e2e:cov": "cross-env NODE_ENV=test nyc --reporter=html --reporter=text mocha test/e2e/test.js --timeout 20000 --exit"
},
"author": "TCSCODER",
"license": "none",
"devDependencies": {
"cross-env": "^7.0.3",
"mocha": "^7.1.2",
"mocha-prepare": "^0.1.0",
"nock": "^12.0.3",
"nyc": "^14.1.1",
"should": "^13.2.3",
"sinon": "^10.0.1",
"standard": "^12.0.1",
"stringcase": "^4.3.1",
"superagent": "^5.1.0"
Expand Down
Loading