Skip to content

Feature/role jd parser2 #343

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
51 commits
Select commit Hold shift + click to select a range
67c82a7
Batch Payments - Part 1 - Scheduler
xxcxy Jun 2, 2021
ac7f0e4
add new topic: action.retry
eisbilir Jun 3, 2021
81772c0
fix: unit tests
eisbilir Jun 3, 2021
15a00f4
fix some review issues
xxcxy Jun 5, 2021
a674ef9
Merge branch 'dev' of https://github.com/topcoder-platform/taas-apis …
xxcxy Jun 5, 2021
71f53c7
adjust jobIds issue
Jun 7, 2021
f63256b
Merge pull request #308 from xxcxy/feature/payment-scheduler
maxceem Jun 8, 2021
cea46cf
Merge branch 'dev' into feature/payment-scheduler
maxceem Jun 8, 2021
98d9b05
fix: swagger resolve conflict issue
maxceem Jun 8, 2021
425e62f
fix: payment amount calculation
maxceem Jun 8, 2021
cf3dec2
use payment scheduler step identifiers
xxcxy Jun 8, 2021
2118902
fix scheduler bugs
xxcxy Jun 9, 2021
0ec2d7f
fix: issue #316
yoution Jun 9, 2021
eb29a8c
Update helper.js
nkumar-topcoder Jun 9, 2021
a1cf99f
Update WorkPeriodService.js
nkumar-topcoder Jun 9, 2021
cc5222d
Merge pull request #324 from topcoder-platform/feature/topic-bus-key
nkumar-topcoder Jun 9, 2021
e36a53e
Update helper.js
nkumar-topcoder Jun 9, 2021
7c80214
Update WorkPeriodService.js
nkumar-topcoder Jun 9, 2021
440234d
Merge pull request #325 from topcoder-platform/feature/topic-bus-key
nkumar-topcoder Jun 9, 2021
7894bb5
Merge pull request #306 from eisbilir/new-action-topic
maxceem Jun 9, 2021
c24752a
Merge pull request #315 from topcoder-platform/feature/add-jobIds
LieutenantRoger Jun 9, 2021
6eccb50
Merge pull request #319 from xxcxy/feature/payment-scheduler
maxceem Jun 9, 2021
7c8cf21
fix: payment schedule for real payments
maxceem Jun 9, 2021
af6e988
fix #307
xxcxy Jun 9, 2021
ae782d5
job description parser
eisbilir Jun 9, 2021
509adf8
Merge pull request #322 from yoution/hotfix/job-status2
LieutenantRoger Jun 10, 2021
60660ce
Merge branch 'dev' into hotfix/job-status
Jun 10, 2021
5f33ef0
Merge pull request #328 from topcoder-platform/hotfix/job-status
LieutenantRoger Jun 10, 2021
7c67759
Merge pull request #327 from xxcxy/dev
maxceem Jun 10, 2021
9d4d436
Merge branch 'dev' into feature/payment-scheduler
maxceem Jun 10, 2021
7f168a4
fix #332
xxcxy Jun 11, 2021
e2fc2dd
fix: Added allow empty validation for string fields in Job and Jobs C…
sushilshinde Jun 11, 2021
75b9baf
ci: deploy on dev env
sushilshinde Jun 11, 2021
705ef9d
Merge pull request #318 from topcoder-platform/feature/payment-scheduler
maxceem Jun 11, 2021
5d23c81
fix: migration script for scheduler
maxceem Jun 11, 2021
ff91b38
fix: added annunal, another rate type
sushilshinde Jun 11, 2021
09368f1
fix: allow empty string
sushilshinde Jun 11, 2021
d898555
fix: allow empty
sushilshinde Jun 11, 2021
dcb0a13
fix: empty string fix
sushilshinde Jun 11, 2021
bf32afb
fix: updated swagger
sushilshinde Jun 11, 2021
da72528
Include addition param key to Postevent method #329
xxcxy Jun 11, 2021
6d4a177
Merge pull request #336 from xxcxy/feature/topic-bus-key
maxceem Jun 11, 2021
e4a0201
docs: improve README
maxceem Jun 11, 2021
cc7749b
Merge pull request #335 from topcoder-platform/change-validatations-i…
sushilshinde Jun 11, 2021
f7706b7
Merge pull request #338 from topcoder-platform/feature/topic-bus-key
maxceem Jun 11, 2021
66b97a5
Merge branch 'dev' into dev
maxceem Jun 11, 2021
3f131e0
Merge pull request #333 from xxcxy/dev
maxceem Jun 11, 2021
e6e5348
fix: lint
maxceem Jun 11, 2021
6ba5f16
docs: improve Swagger
maxceem Jun 11, 2021
216c256
clear unnecessary function call
eisbilir Jun 13, 2021
627118d
Merge dev into feature/role-jd-parser2 - resolve conflict
eisbilir Jun 13, 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 .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ workflows:
branches:
only:
- dev
- change-validatations-in-job-jc

# Production builds are exectuted only on tagged commits to the
# master branch.
Expand Down
17 changes: 16 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -103,10 +103,11 @@
tc-taas-es-processor | 2021-04-09T21:20:21.469Z DEBUG no-kafka-client Subscribed to taas.workperiodpayment.update:0 offset 0 leader kafka:9093
tc-taas-es-processor | 2021-04-09T21:20:21.470Z DEBUG no-kafka-client Subscribed to taas.workperiodpayment.delete:0 offset 0 leader kafka:9093
tc-taas-es-processor | 2021-04-09T21:20:21.471Z DEBUG no-kafka-client Subscribed to taas.workperiodpayment.create:0 offset 0 leader kafka:9093
tc-taas-es-processor | 2021-04-09T21:20:21.472Z DEBUG no-kafka-client Subscribed to taas.action.retry:0 offset 0 leader kafka:9093
tc-taas-es-processor | 2021-04-09T21:20:21.473Z DEBUG no-kafka-client Subscribed to taas.job.update:0 offset 0 leader kafka:9093
tc-taas-es-processor | 2021-04-09T21:20:21.474Z DEBUG no-kafka-client Subscribed to taas.resourcebooking.update:0 offset 0 leader kafka:9093
tc-taas-es-processor | [2021-04-09T21:20:21.475Z] app INFO : Initialized.......
tc-taas-es-processor | [2021-04-09T21:20:21.479Z] app INFO : taas.job.create,taas.job.update,taas.job.delete,taas.jobcandidate.create,taas.jobcandidate.update,taas.jobcandidate.delete,taas.resourcebooking.create,taas.resourcebooking.update,taas.resourcebooking.delete,taas.workperiod.create,taas.workperiod.update,taas.workperiod.delete,taas.workperiodpayment.create,taas.workperiodpayment.update,taas.interview.requested,taas.interview.update,taas.interview.bulkUpdate,taas.role.requested,taas.role.update,taas.role.delete
tc-taas-es-processor | [2021-04-09T21:20:21.479Z] app INFO : common.error.reporting,taas.job.create,taas.job.update,taas.job.delete,taas.jobcandidate.create,taas.jobcandidate.update,taas.jobcandidate.delete,taas.resourcebooking.create,taas.resourcebooking.update,taas.resourcebooking.delete,taas.workperiod.create,taas.workperiod.update,taas.workperiod.delete,taas.workperiodpayment.create,taas.workperiodpayment.update,taas.interview.requested,taas.interview.update,taas.interview.bulkUpdate,taas.role.requested,taas.role.update,taas.role.delete,taas.action.retry
tc-taas-es-processor | [2021-04-09T21:20:21.480Z] app INFO : Kick Start.......
tc-taas-es-processor | ********** Topcoder Health Check DropIn listening on port 3001
tc-taas-es-processor | Topcoder Health Check DropIn started and ready to roll
Expand Down Expand Up @@ -176,6 +177,19 @@ To be able to change and test `taas-es-processor` locally you can follow the nex
2. Run `taas-es-processor` separately from the source code. As `npm run services:up` already run all the dependencies for both `taas-apis` and for `taas-es-processor`. The only thing you need to do for running `taas-es-processor` locally is clone the [taas-es-processor](https://github.com/topcoder-platform/taas-es-processor) repository and inside `taas-es-processor` folder run:
- `nvm use` - to use correct Node version
- `npm run install`
- Create `.env` file with the next environment variables. Values for **Auth0 config** should be shared with you on the forum.<br>

```bash
# Auth0 config
AUTH0_URL=
AUTH0_AUDIENCE=
AUTH0_CLIENT_ID=
AUTH0_CLIENT_SECRET=
```

- Values from this file would be automatically used by many `npm` commands.
- ⚠️ Never commit this file or its copy to the repository!

- `npm run start`

## NPM Commands
Expand Down Expand Up @@ -206,6 +220,7 @@ To be able to change and test `taas-es-processor` locally you can follow the nex
| `npm run cov` | Code Coverage Report. |
| `npm run migrate` | Run any migration files which haven't run yet. |
| `npm run migrate:undo` | Revert most recent migration. |
| `npm run demo-payment-scheduler` | Create 1000 Work Periods Payment records in with status "scheduled" and various "amount" |

## Import and Export data

Expand Down
24 changes: 21 additions & 3 deletions app-constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,24 @@ const ChallengeStatus = {

const WorkPeriodPaymentStatus = {
COMPLETED: 'completed',
CANCELLED: 'cancelled',
SCHEDULED: 'scheduled'
SCHEDULED: 'scheduled',
IN_PROGRESS: 'in-progress',
FAILED: 'failed',
CANCELLED: 'cancelled'
}

const PaymentProcessingSwitch = {
ON: 'ON',
OFF: 'OFF'
}

const PaymentSchedulerStatus = {
START_PROCESS: 'start-process',
CREATE_CHALLENGE: 'create-challenge',
ASSIGN_MEMBER: 'assign-member',
ACTIVATE_CHALLENGE: 'activate-challenge',
GET_USER_ID: 'get-userId',
CLOSE_CHALLENGE: 'close-challenge'
}

module.exports = {
Expand All @@ -96,5 +112,7 @@ module.exports = {
Scopes,
Interviews,
ChallengeStatus,
WorkPeriodPaymentStatus
WorkPeriodPaymentStatus,
PaymentSchedulerStatus,
PaymentProcessingSwitch
}
4 changes: 4 additions & 0 deletions app.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ const schedule = require('node-schedule')
const logger = require('./src/common/logger')
const eventHandlers = require('./src/eventHandlers')
const interviewService = require('./src/services/InterviewService')
const { processScheduler } = require('./src/services/PaymentSchedulerService')

// setup express app
const app = express()
Expand Down Expand Up @@ -97,6 +98,9 @@ const server = app.listen(app.get('port'), () => {
eventHandlers.init()
// schedule updateCompletedInterviews to run every hour
schedule.scheduleJob('0 0 * * * *', interviewService.updateCompletedInterviews)

// schedule payment processing
schedule.scheduleJob(config.PAYMENT_PROCESSING.CRON, processScheduler)
})

if (process.env.NODE_ENV === 'test') {
Expand Down
41 changes: 40 additions & 1 deletion config/default.js
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,8 @@ module.exports = {
TAAS_ROLE_UPDATE_TOPIC: process.env.TAAS_ROLE_UPDATE_TOPIC || 'taas.role.update',
// the delete role entity Kafka message topic
TAAS_ROLE_DELETE_TOPIC: process.env.TAAS_ROLE_DELETE_TOPIC || 'taas.role.delete',
// special kafka topics
TAAS_ACTION_RETRY_TOPIC: process.env.TAAS_ACTION_RETRY_TOPIC || 'taas.action.retry',

// the Kafka message topic for sending email
EMAIL_TOPIC: process.env.EMAIL_TOPIC || 'external.action.email',
Expand Down Expand Up @@ -173,5 +175,42 @@ module.exports = {
// the minimum matching rate when searching roles by skills
ROLE_MATCHING_RATE: process.env.ROLE_MATCHING_RATE || 0.70,
// member groups representing Wipro or TopCoder employee
INTERNAL_MEMBER_GROUPS: process.env.INTERNAL_MEMBER_GROUPS || ['20000000', '20000001', '20000003', '20000010', '20000015']
INTERNAL_MEMBER_GROUPS: process.env.INTERNAL_MEMBER_GROUPS || ['20000000', '20000001', '20000003', '20000010', '20000015'],
// Topcoder skills cache time in minutes
TOPCODER_SKILLS_CACHE_TIME: process.env.TOPCODER_SKILLS_CACHE_TIME || 60,
// payment scheduler config
PAYMENT_PROCESSING: {
// switch off actual API calls in Payment Scheduler
SWITCH: process.env.PAYMENT_PROCESSING_SWITCH || 'OFF',
// the payment scheduler cron config
CRON: process.env.PAYMENT_PROCESSING_CRON || '0 */5 * * * *',
// the number of records processed by one time
BATCH_SIZE: parseInt(process.env.PAYMENT_PROCESSING_BATCH_SIZE || 50),
// in-progress expired to determine whether a record has been processed abnormally, moment duration format
IN_PROGRESS_EXPIRED: process.env.IN_PROGRESS_EXPIRED || 'PT1H',
// the number of max retry config
MAX_RETRY_COUNT: parseInt(process.env.PAYMENT_PROCESSING_MAX_RETRY_COUNT || 10),
// the time of retry base delay, unit: ms
RETRY_BASE_DELAY: parseInt(process.env.PAYMENT_PROCESSING_RETRY_BASE_DELAY || 100),
// the time of retry max delay, unit: ms
RETRY_MAX_DELAY: parseInt(process.env.PAYMENT_PROCESSING_RETRY_MAX_DELAY || 10000),
// the max time of one request, unit: ms
PER_REQUEST_MAX_TIME: parseInt(process.env.PAYMENT_PROCESSING_PER_REQUEST_MAX_TIME || 30000),
// the max time of one payment record, unit: ms
PER_PAYMENT_MAX_TIME: parseInt(process.env.PAYMENT_PROCESSING_PER_PAYMENT_MAX_TIME || 60000),
// the max records of payment of a minute
PER_MINUTE_PAYMENT_MAX_COUNT: parseInt(process.env.PAYMENT_PROCESSING_PER_MINUTE_PAYMENT_MAX_COUNT || 12),
// the max requests of challenge of a minute
PER_MINUTE_CHALLENGE_REQUEST_MAX_COUNT: parseInt(process.env.PAYMENT_PROCESSING_PER_MINUTE_CHALLENGE_REQUEST_MAX_COUNT || 60),
// the max requests of resource of a minute
PER_MINUTE_RESOURCE_REQUEST_MAX_COUNT: parseInt(process.env.PAYMENT_PROCESSING_PER_MINUTE_CHALLENGE_REQUEST_MAX_COUNT || 20),
// the default step fix delay, unit: ms
FIX_DELAY_STEP: parseInt(process.env.PAYMENT_PROCESSING_FIX_DELAY_STEP || 500),
// the fix delay after step of create challenge, unit: ms
FIX_DELAY_STEP_CREATE_CHALLENGE: parseInt(process.env.PAYMENT_PROCESSING_FIX_DELAY_STEP_CREATE_CHALLENGE || process.env.PAYMENT_PROCESSING_FIX_DELAY_STEP || 500),
// the fix delay after step of assign member, unit: ms
FIX_DELAY_STEP_ASSIGN_MEMBER: parseInt(process.env.PAYMENT_PROCESSING_FIX_DELAY_STEP_ASSIGN_MEMBER || process.env.PAYMENT_PROCESSING_FIX_DELAY_STEP || 500),
// the fix delay after step of activate challenge, unit: ms
FIX_DELAY_STEP_ACTIVATE_CHALLENGE: parseInt(process.env.PAYMENT_PROCESSING_FIX_DELAY_STEP_ACTIVATE_CHALLENGE || process.env.PAYMENT_PROCESSING_FIX_DELAY_STEP || 500)
}
}
Loading