-
Notifications
You must be signed in to change notification settings - Fork 1
/
schemas.js
29 lines (26 loc) · 903 Bytes
/
schemas.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
const Joi = require('joi');
module.exports.carpoolSchema = Joi.object({
carpool: Joi.object({
// driver_username: Joi.string().required(),
time: Joi.string().required(),
price: Joi.number().required().min(0),
car_plate: Joi.string().required(),
departure_city: Joi.string().required(),
destination_city: Joi.string().required(),
availability: Joi.string().required()
}).required()
});
module.exports.driverSchema = Joi.object({
driver: Joi.object({
username: Joi.string().required(),
license_num: Joi.string().required()
}).required()
});
module.exports.carSchema = Joi.object({
car: Joi.object({
plate_num: Joi.string().required(),
description: Joi.string().required(),
max_seats: Joi.number().required().min(1)
// image: Joi.string().required()
}).required()
});