diff --git a/api/src/certification/flash-certification/application/scenario-simulator-route.js b/api/src/certification/flash-certification/application/scenario-simulator-route.js index d4483c55698..a5ebec53887 100644 --- a/api/src/certification/flash-certification/application/scenario-simulator-route.js +++ b/api/src/certification/flash-certification/application/scenario-simulator-route.js @@ -3,13 +3,6 @@ import Joi from 'joi'; import { securityPreHandlers } from '../../../shared/application/security-pre-handlers.js'; import { scenarioSimulatorController } from './scenario-simulator-controller.js'; -const _baseScenarioParametersValidator = Joi.object().keys({ - initialCapacity: Joi.number().integer().min(-8).max(8), - numberOfIterations: Joi.number().integer().min(0), - challengePickProbability: Joi.number().min(0).max(100), - variationPercent: Joi.number().min(0).max(1), -}); - const register = async (server) => { server.route([ { @@ -26,8 +19,12 @@ const register = async (server) => { options: { allowUnknown: true, }, - payload: _baseScenarioParametersValidator + payload: Joi.object() .keys({ + initialCapacity: Joi.number().integer().min(-8).max(8), + numberOfIterations: Joi.number().integer().min(0), + challengePickProbability: Joi.number().min(0).max(100), + variationPercent: Joi.number().min(0).max(1), capacity: Joi.number().min(-8).max(8).required(), }) .required(),