diff --git a/src/reducers/schema/eventSchema.js b/src/reducers/schema/eventSchema.js index ae308e0..fb42cf5 100644 --- a/src/reducers/schema/eventSchema.js +++ b/src/reducers/schema/eventSchema.js @@ -3,22 +3,25 @@ import Joi from 'joi'; const eventSchema = Joi.object().keys({ id: Joi.string().required(), description: Joi.string().allow('').required(), - date: Joi.string().required(), - time: Joi.string().required(), + date: Joi.string().allow(''), + time: Joi.string().allow(''), time_precision: Joi.string().allow(''), - location: Joi.string().allow('').required(), - latitude: Joi.string().allow('').required(), - longitude: Joi.string().allow('').required(), + location: Joi.string().allow(''), + latitude: Joi.string().allow(''), + longitude: Joi.string().allow(''), type: Joi.string().allow(''), category: Joi.string().required(), narratives: Joi.array(), sources: Joi.array(), tags: Joi.array().allow(''), comments: Joi.string().allow(''), - timestamp: Joi.string().required(), + timestamp: Joi.string(), // nested narrative___stepStyles: Joi.array(), -}); +}) + .and('latitude', 'longitude') + .and('date', 'time', 'timestamp') + .or('timestamp', 'latitude') -export default eventSchema; +export default eventSchema