const Schwifty = require('@hapipal/schwifty') const Joi = require('joi') const User = require('./user') const queueSchema = require('../schemas/queues') module.exports = class MatchQueue extends Schwifty.Model { static get tableName() { return 'match_queues' } static get relationMappings() { return { user: { relation: Schwifty.Model.HasOneThroughRelation, modelClass: User, join: { from: 'match_queues.target_id', through: { from: 'profiles.profile_id', to: 'profiles.user_id', }, to: 'users.user_id', }, }, } } static get joiSchema() { return queueSchema.single } }