iut-hapi/lib/models/favorite.js

23 lines
579 B
JavaScript

'use strict';
const Joi = require('joi');
const { Model } = require('@hapipal/schwifty');
module.exports = class Favorite extends Model {
static get tableName() {
return 'favorites';
}
static get joiSchema() {
return Joi.object({
id: Joi.number().integer().greater(0),
user_id: Joi.number().integer().greater(0).required().example(1).description('User id'),
movie_id: Joi.number().integer().greater(0).required().example(1).description('Movie id')
});
}
}