{"size": 882, "ext": "js", "max_stars_repo_path": "backend/src/validators/IncidentValidator.js", "max_stars_repo_name": "luanfonsecap/be-the-hero", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "backend/src/validators/IncidentValidator.js", "max_issues_repo_name": "luanfonsecap/be-the-hero", "max_issues_repo_issues_event_min_datetime": "2021-09-02T08:55:26.000Z", "max_issues_repo_issues_event_max_datetime": "2022-02-19T06:18:59.000Z", "max_forks_repo_path": "backend/src/validators/IncidentValidator.js", "max_forks_repo_name": "luanfonsecap/be-the-hero", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": 2, "max_forks_count": null, "avg_line_length": 21.0, "max_line_length": 48, "alphanum_fraction": 0.5464852608}
const { Segments, Joi } = require("celebrate");

module.exports = {
  index: {
    [Segments.QUERY]: Joi.object().keys({
      page: Joi.number(),
    }),
  },

  create: {
    [Segments.BODY]: Joi.object().keys({
      title: Joi.string().min(5).required(),
      description: Joi.string().required(),
      value: Joi.number().positive().required(),
    }),
    [Segments.HEADERS]: Joi.object({
      authorization: Joi.string().required(),
    }).unknown(),
  },

  delete: {
    [Segments.PARAMS]: Joi.object().keys({
      id: Joi.number().required(),
    }),
    [Segments.HEADERS]: Joi.object({
      authorization: Joi.string().required(),
    }).unknown(),
  },

  update: {
    [Segments.PARAMS]: Joi.object().keys({
      id: Joi.number().required(),
    }),
  },

  search: {
    [Segments.PARAMS]: Joi.object().keys({
      id: Joi.number().required(),
    }),
  },
};
