Files
DiceCloud/app/imports/api/properties/subSchemas/InlineComputationSchema.js
2022-10-09 16:01:36 +02:00

25 lines
633 B
JavaScript

import SimpleSchema from 'simpl-schema';
import ErrorSchema from '/imports/api/properties/subSchemas/ErrorSchema.js';
import STORAGE_LIMITS from '/imports/constants/STORAGE_LIMITS.js';
const InlineComputationSchema = new SimpleSchema({
// The part between bracers {}
calculation: {
type: String,
max: STORAGE_LIMITS.calculation,
},
value: {
type: SimpleSchema.oneOf(String, Number),
optional: true,
max: STORAGE_LIMITS.calculation,
},
errors: {
type: Array,
optional: true,
maxCount: STORAGE_LIMITS.errorCount,
},
'errors.$': ErrorSchema,
});
export default InlineComputationSchema;