| 1234567891011121314151617181920212223242526272829303132333435363738 |
- const Joi = require('joi')
-
- /**
- * Match Queue
- * A match queue record stores prematched target-profiles
- * to display *in order* for the logged-in profile.
- *
- * example:
- * { profile_id: 2, target_id: 54 }
- * { profile_id: 2, target_id: 27 }
- * { profile_id: 2, target_id: 83 }
- *
- * This example will display profiles 54, 27, 83 to
- * profile 2 when they login.
- */
-
- // validator is used to validate route input/output
- const validator = Joi.object({
- match_queue_id: Joi.number(),
- profile_id: Joi.number().required(),
- target_id: Joi.number().required(),
- }).label('queue__single_validator')
-
- const list = Joi.array().items(validator).label('queue__list_validator')
-
- // single is used to define database models
- const single = Joi.object({
- match_queue_id: Joi.number(),
- profile_id: Joi.number().required(),
- target_id: Joi.number().required(),
- _is_deleted: Joi.boolean().required(),
- }).label('queue__single')
-
- module.exports = {
- single,
- validator,
- list,
- }
|