| 1234567891011121314151617181920212223242526272829 |
- 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
- }
- }
|