From f8bb4a7d73cde72dc11bee271c575aeecb60ae9c Mon Sep 17 00:00:00 2001 From: Bastien Seree Date: Wed, 2 Oct 2024 16:52:30 +0200 Subject: [PATCH] Cyberleague: [#174] Add pay enum field to carreer schema --- backend/web/server/plugins/cyberleague/functions.js | 3 ++- .../server/plugins/cyberleague/schemas/CarreerSchema.js | 7 ++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/backend/web/server/plugins/cyberleague/functions.js b/backend/web/server/plugins/cyberleague/functions.js index 634ce4a091..08b2eab5c9 100644 --- a/backend/web/server/plugins/cyberleague/functions.js +++ b/backend/web/server/plugins/cyberleague/functions.js @@ -11,7 +11,7 @@ const { setPostPutData, idEqual, } = require('../../utils/database') -const { ROLES, SECTOR, EXPERTISE_CATEGORIES, CONTENT_TYPE, JOBS, COMPANY_SIZE, ROLE_PARTNER, ROLE_ADMIN, ROLE_MEMBER, ESTIMATED_DURATION_UNITS, LOOKING_FOR_MISSION, CONTENT_VISIBILITY, EVENT_VISIBILITY, ANSWERS, QUESTION_CATEGORIES, SCORE_LEVELS, COIN_SOURCES, SCORE_LEVEL_1, SCORE_LEVEL_3, SCORE_LEVEL_2, STATUTS, GROUP_VISIBILITY, USER_LEVELS, CONTRACT_TYPES, WORK_DURATIONS } = require('./consts') +const { ROLES, SECTOR, EXPERTISE_CATEGORIES, CONTENT_TYPE, JOBS, COMPANY_SIZE, ROLE_PARTNER, ROLE_ADMIN, ROLE_MEMBER, ESTIMATED_DURATION_UNITS, LOOKING_FOR_MISSION, CONTENT_VISIBILITY, EVENT_VISIBILITY, ANSWERS, QUESTION_CATEGORIES, SCORE_LEVELS, COIN_SOURCES, SCORE_LEVEL_1, SCORE_LEVEL_3, SCORE_LEVEL_2, STATUTS, GROUP_VISIBILITY, USER_LEVELS, CONTRACT_TYPES, WORK_DURATIONS, PAY } = require('./consts') const { PURCHASE_STATUS } = require('../../../utils/consts') const Company = require('../../models/Company') const { BadRequestError, ForbiddenError } = require('../../utils/errors') @@ -313,6 +313,7 @@ declareEnumField( {model: 'purchase', field: 'status', enumValues: PURCHASE_STAT //Carreer declarations declareEnumField({model: 'carreer', field: 'contract_type', enumValues: CONTRACT_TYPES}) declareEnumField({model: 'carreer', field: 'work_duration', enumValues: WORK_DURATIONS}) +declareEnumField({model: 'carreer', field: 'pay', enumValues: PAY}) diff --git a/backend/web/server/plugins/cyberleague/schemas/CarreerSchema.js b/backend/web/server/plugins/cyberleague/schemas/CarreerSchema.js index 5fa3ea6635..c5ea72f13d 100644 --- a/backend/web/server/plugins/cyberleague/schemas/CarreerSchema.js +++ b/backend/web/server/plugins/cyberleague/schemas/CarreerSchema.js @@ -1,6 +1,6 @@ const mongoose = require('mongoose') const { schemaOptions } = require('../../../utils/schemas') -const { CONTRACT_TYPES, WORK_DURATIONS } = require('../consts') +const { CONTRACT_TYPES, WORK_DURATIONS, PAY } = require('../consts') const Schema = mongoose.Schema @@ -49,6 +49,11 @@ const CarreerSchema = new Schema( enum: Object.keys(WORK_DURATIONS), required: false }, + pay: { + type: String, + enum: Object.keys(PAY), + required: false + }, }, schemaOptions )