Skip to content

fix: taas-app issue #364 #396

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 1 commit into from
Jul 15, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
8 changes: 7 additions & 1 deletion data/demo-data.json
Original file line number Diff line number Diff line change
Expand Up @@ -7732,6 +7732,9 @@
"global": 50,
"offShore": 10,
"inCountry": 20,
"niche": 50,
"rate20Niche": 20,
"rate30Niche": 10,
"rate20Global": 20,
"rate30Global": 20,
"rate20OffShore": 35,
Expand All @@ -7743,6 +7746,9 @@
"global": 25,
"offShore": 5,
"inCountry": 15,
"niche": 50,
"rate20Niche": 20,
"rate30Niche": 10,
"rate20Global": 20,
"rate30Global": 20,
"rate20OffShore": 35,
Expand All @@ -7762,4 +7768,4 @@
"updatedAt": "2021-05-27T21:43:09.342Z"
}
]
}
}
14 changes: 10 additions & 4 deletions docs/swagger.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5555,12 +5555,11 @@ components:
example: 300
description: "The time to interview."
RoleRates:
required:
- global
- inCountry
- offShore
type: object
properties:
niche:
type: integer
example: 10
global:
type: integer
example: 10
Expand All @@ -5570,6 +5569,9 @@ components:
offShore:
type: integer
example: 30
rate30Niche:
type: integer
example: 10
rate30Global:
type: integer
example: 10
Expand All @@ -5579,6 +5581,9 @@ components:
rate30OffShore:
type: integer
example: 30
rate20Niche:
type: integer
example: 10
rate20Global:
type: integer
example: 10
Expand Down Expand Up @@ -5772,3 +5777,4 @@ components:
properties:
message:
type: string

3 changes: 3 additions & 0 deletions src/common/helper.js
Original file line number Diff line number Diff line change
Expand Up @@ -249,6 +249,9 @@ esIndexPropertyMapping[config.get('esConfig.ES_INDEX_ROLE')] = {
global: { type: 'integer' },
inCountry: { type: 'integer' },
offShore: { type: 'integer' },
niche: { type: 'integer' },
rate20niche: { type: 'integer' },
rate30niche: { type: 'integer' },
rate30Global: { type: 'integer' },
rate30InCountry: { type: 'integer' },
rate30OffShore: { type: 'integer' },
Expand Down
21 changes: 15 additions & 6 deletions src/models/Role.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,18 +55,27 @@ module.exports = (sequelize) => {
type: Sequelize.ARRAY({
type: Sequelize.JSONB({
global: {
type: Sequelize.SMALLINT,
allowNull: false
type: Sequelize.SMALLINT
},
inCountry: {
field: 'in_country',
type: Sequelize.SMALLINT,
allowNull: false
type: Sequelize.SMALLINT
},
offShore: {
field: 'off_shore',
type: Sequelize.SMALLINT,
allowNull: false
type: Sequelize.SMALLINT
},
niche: {
field: 'niche',
type: Sequelize.SMALLINT
},
rate20Niche: {
field: 'rate20_niche',
type: Sequelize.SMALLINT
},
rate30Niche: {
field: 'rate30_niche',
type: Sequelize.SMALLINT
},
rate30Global: {
field: 'rate30_global',
Expand Down
9 changes: 6 additions & 3 deletions src/services/RoleService.js
Original file line number Diff line number Diff line change
Expand Up @@ -131,12 +131,15 @@ createRole.schema = Joi.object().keys({
description: Joi.string().max(1000),
listOfSkills: Joi.array().items(Joi.string().max(50).required()),
rates: Joi.array().items(Joi.object().keys({
global: Joi.smallint().required(),
inCountry: Joi.smallint().required(),
offShore: Joi.smallint().required(),
global: Joi.smallint(),
inCountry: Joi.smallint(),
offShore: Joi.smallint(),
niche: Joi.smallint(),
rate30Niche: Joi.smallint(),
rate30Global: Joi.smallint(),
rate30InCountry: Joi.smallint(),
rate30OffShore: Joi.smallint(),
rate20Niche: Joi.smallint(),
rate20Global: Joi.smallint(),
rate20InCountry: Joi.smallint(),
rate20OffShore: Joi.smallint()
Expand Down
2 changes: 1 addition & 1 deletion src/services/TeamService.js
Original file line number Diff line number Diff line change
Expand Up @@ -998,7 +998,7 @@ async function _cleanRoleDTO (currentUser, role) {
role.isExternalMember = true
if (role.rates) {
role.rates = _.map(role.rates, rate =>
_.omit(rate, ['inCountry', 'offShore', 'rate30InCountry', 'rate30OffShore', 'rate20InCountry', 'rate20OffShore']))
_.omit(rate, ['inCountry', 'offShore', 'niche', 'rate30InCountry', 'rate30OffShore', 'rate30Niche', 'rate20InCountry', 'rate20OffShore', 'rate20Niche']))
}
return role
}
Expand Down