Skip to content

Commit 4f96a8f

Browse files
committed
fix: taas-app issue #364
1 parent f262c45 commit 4f96a8f

File tree

6 files changed

+42
-15
lines changed

6 files changed

+42
-15
lines changed

data/demo-data.json

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7732,6 +7732,9 @@
77327732
"global": 50,
77337733
"offShore": 10,
77347734
"inCountry": 20,
7735+
"niche": 50,
7736+
"rate20Niche": 20,
7737+
"rate30Niche": 10,
77357738
"rate20Global": 20,
77367739
"rate30Global": 20,
77377740
"rate20OffShore": 35,
@@ -7743,6 +7746,9 @@
77437746
"global": 25,
77447747
"offShore": 5,
77457748
"inCountry": 15,
7749+
"niche": 50,
7750+
"rate20Niche": 20,
7751+
"rate30Niche": 10,
77467752
"rate20Global": 20,
77477753
"rate30Global": 20,
77487754
"rate20OffShore": 35,
@@ -7762,4 +7768,4 @@
77627768
"updatedAt": "2021-05-27T21:43:09.342Z"
77637769
}
77647770
]
7765-
}
7771+
}

docs/swagger.yaml

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5555,12 +5555,11 @@ components:
55555555
example: 300
55565556
description: "The time to interview."
55575557
RoleRates:
5558-
required:
5559-
- global
5560-
- inCountry
5561-
- offShore
55625558
type: object
55635559
properties:
5560+
niche:
5561+
type: integer
5562+
example: 10
55645563
global:
55655564
type: integer
55665565
example: 10
@@ -5570,6 +5569,9 @@ components:
55705569
offShore:
55715570
type: integer
55725571
example: 30
5572+
rate30Niche:
5573+
type: integer
5574+
example: 10
55735575
rate30Global:
55745576
type: integer
55755577
example: 10
@@ -5579,6 +5581,9 @@ components:
55795581
rate30OffShore:
55805582
type: integer
55815583
example: 30
5584+
rate20Niche:
5585+
type: integer
5586+
example: 10
55825587
rate20Global:
55835588
type: integer
55845589
example: 10
@@ -5772,3 +5777,4 @@ components:
57725777
properties:
57735778
message:
57745779
type: string
5780+

src/common/helper.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -249,6 +249,9 @@ esIndexPropertyMapping[config.get('esConfig.ES_INDEX_ROLE')] = {
249249
global: { type: 'integer' },
250250
inCountry: { type: 'integer' },
251251
offShore: { type: 'integer' },
252+
niche: { type: 'integer' },
253+
rate20niche: { type: 'integer' },
254+
rate30niche: { type: 'integer' },
252255
rate30Global: { type: 'integer' },
253256
rate30InCountry: { type: 'integer' },
254257
rate30OffShore: { type: 'integer' },

src/models/Role.js

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -55,18 +55,27 @@ module.exports = (sequelize) => {
5555
type: Sequelize.ARRAY({
5656
type: Sequelize.JSONB({
5757
global: {
58-
type: Sequelize.SMALLINT,
59-
allowNull: false
58+
type: Sequelize.SMALLINT
6059
},
6160
inCountry: {
6261
field: 'in_country',
63-
type: Sequelize.SMALLINT,
64-
allowNull: false
62+
type: Sequelize.SMALLINT
6563
},
6664
offShore: {
6765
field: 'off_shore',
68-
type: Sequelize.SMALLINT,
69-
allowNull: false
66+
type: Sequelize.SMALLINT
67+
},
68+
niche: {
69+
field: 'niche',
70+
type: Sequelize.SMALLINT
71+
},
72+
rate20Niche: {
73+
field: 'rate20_niche',
74+
type: Sequelize.SMALLINT
75+
},
76+
rate30Niche: {
77+
field: 'rate30_niche',
78+
type: Sequelize.SMALLINT
7079
},
7180
rate30Global: {
7281
field: 'rate30_global',

src/services/RoleService.js

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -131,12 +131,15 @@ createRole.schema = Joi.object().keys({
131131
description: Joi.string().max(1000),
132132
listOfSkills: Joi.array().items(Joi.string().max(50).required()),
133133
rates: Joi.array().items(Joi.object().keys({
134-
global: Joi.smallint().required(),
135-
inCountry: Joi.smallint().required(),
136-
offShore: Joi.smallint().required(),
134+
global: Joi.smallint(),
135+
inCountry: Joi.smallint(),
136+
offShore: Joi.smallint(),
137+
niche: Joi.smallint(),
138+
rate30Niche: Joi.smallint(),
137139
rate30Global: Joi.smallint(),
138140
rate30InCountry: Joi.smallint(),
139141
rate30OffShore: Joi.smallint(),
142+
rate20Niche: Joi.smallint(),
140143
rate20Global: Joi.smallint(),
141144
rate20InCountry: Joi.smallint(),
142145
rate20OffShore: Joi.smallint()

src/services/TeamService.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -998,7 +998,7 @@ async function _cleanRoleDTO (currentUser, role) {
998998
role.isExternalMember = true
999999
if (role.rates) {
10001000
role.rates = _.map(role.rates, rate =>
1001-
_.omit(rate, ['inCountry', 'offShore', 'rate30InCountry', 'rate30OffShore', 'rate20InCountry', 'rate20OffShore']))
1001+
_.omit(rate, ['inCountry', 'offShore', 'niche', 'rate30InCountry', 'rate30OffShore', 'rate30Niche', 'rate20InCountry', 'rate20OffShore', 'rate20Niche']))
10021002
}
10031003
return role
10041004
}

0 commit comments

Comments
 (0)