-
Notifications
You must be signed in to change notification settings - Fork 32
Change validatations in job jc #335
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
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
e2fc2dd
fix: Added allow empty validation for string fields in Job and Jobs C…
sushilshinde 75b9baf
ci: deploy on dev env
sushilshinde ff91b38
fix: added annunal, another rate type
sushilshinde 09368f1
fix: allow empty string
sushilshinde d898555
fix: allow empty
sushilshinde dcb0a13
fix: empty string fix
sushilshinde bf32afb
fix: updated swagger
sushilshinde File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -187,31 +187,35 @@ async function createJob (currentUser, job) { | |
| return created.toJSON() | ||
| } | ||
|
|
||
| createJob.schema = Joi.object().keys({ | ||
| currentUser: Joi.object().required(), | ||
| job: Joi.object().keys({ | ||
| status: Joi.jobStatus().default('sourcing'), | ||
| projectId: Joi.number().integer().required(), | ||
| externalId: Joi.string().allow(null), | ||
| description: Joi.stringAllowEmpty().allow(null), | ||
| title: Joi.title().required(), | ||
| startDate: Joi.date().allow(null), | ||
| duration: Joi.number().integer().min(1).allow(null), | ||
| numPositions: Joi.number().integer().min(1).required(), | ||
| resourceType: Joi.stringAllowEmpty().allow(null), | ||
| rateType: Joi.rateType().allow(null), | ||
| workload: Joi.workload().allow(null), | ||
| skills: Joi.array().items(Joi.string().uuid()).required(), | ||
| isApplicationPageActive: Joi.boolean(), | ||
| 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()) | ||
| }).required() | ||
| }).required() | ||
| createJob.schema = Joi.object() | ||
| .keys({ | ||
| currentUser: Joi.object().required(), | ||
| job: Joi.object() | ||
| .keys({ | ||
| status: Joi.jobStatus().default("sourcing"), | ||
| projectId: Joi.number().integer().required(), | ||
| externalId: Joi.string().allow(null), | ||
| description: Joi.stringAllowEmpty().allow(null), | ||
| title: Joi.title().required(), | ||
| startDate: Joi.date().allow(null), | ||
| duration: Joi.number().integer().min(1).allow(null), | ||
| numPositions: Joi.number().integer().min(1).required(), | ||
| resourceType: Joi.stringAllowEmpty().allow(null), | ||
| rateType: Joi.rateType().allow(null), | ||
| workload: Joi.workload().allow(null), | ||
| skills: Joi.array().items(Joi.string().uuid()).required(), | ||
| isApplicationPageActive: Joi.boolean(), | ||
| minSalary: Joi.number().integer().allow(null), | ||
| maxSalary: Joi.number().integer().allow(null), | ||
| hoursPerWeek: Joi.number().integer().allow(null), | ||
| jobLocation: Joi.string().allow(null).allow(''), | ||
| jobTimezone: Joi.string().allow(null).allow(''), | ||
| currency: Joi.string().allow(null).allow(''), | ||
|
Comment on lines
+211
to
+213
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @sushilshinde same here. |
||
| roleIds: Joi.array().items(Joi.string().uuid().required()), | ||
| }) | ||
| .required(), | ||
| }) | ||
| .required(); | ||
|
|
||
| /** | ||
| * Update job. Normal user can only update the job he/she created. | ||
|
|
||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@sushilshinde we also have a reusable rule
stringAllowEmptyhttps://github.com/topcoder-platform/taas-apis/blob/dev/src/bootstrap.js#L26 which could be reused here for consistency.