const Objection = require('objection') const Schmervice = require('@hapipal/schmervice') const Schwifty = require('@hapipal/schwifty') const MatchQueService = require('../services/matchqueue') const MatchQueModel = require('../models/matchqueue') const MatchQueRoute = require('../routes/matchqueue/matchqueue') const MatchQueChooseRoute = require('../routes/matchqueue/choosematch') module.exports = { name: 'matchqueue-plugin', version: '1.0.0', register: async (server, options) => { await server.register(Schwifty) await server.registerModel(MatchQueModel) server.bind({ transaction: fn => Objection.transaction(server.knex(), fn), }) await server.register(Schmervice) server.registerService(MatchQueService) await server.route(MatchQueRoute) await server.route(MatchQueChooseRoute) }, }