Added check for fluctuation
MODIFY
src/server/rest/v1/service/UtilsService.ts
src/server/rest/v1/service/UtilsService.ts
@@ -555,6 +555,17 @@ export default class UtilsService {
user: req.user.id
});
}
+ if (asset.fluctuationPercent) {
+ if (0 > asset.fluctuationPercent || 100 < asset.fluctuationPercent || !(typeof asset.fluctuationPercent === 'number')) {
+ throw new AppError({
+ source: Constants.CENTRAL_SERVER,
+ errorCode: HTTPError.GENERAL_ERROR,
+ message: 'Fluctuation percentage should be between 0 and 100',
+ module: MODULE_NAME, method: 'checkIfAssetValid',
+ user: req.user.id
+ });
+ }
+ }
if (asset.dynamicAsset) {
if (!asset.connectionID) {
throw new AppError({

Added check for fluctuation