module.exports = Self => { Self.remoteMethod('getMana', { description: 'Returns the boolean mana of a client', accessType: 'READ', accepts: [{ arg: 'id', type: 'number', required: true, description: 'client id', http: {source: 'path'} }], returns: { type: 'number', root: true }, http: { path: `/:id/getMana`, verb: 'GET' } }); Self.getMana = async clientFk => { let query = `SELECT vn.clientGetMana(?) AS mana`; let [mana] = await Self.rawSql(query, [clientFk]); return mana; }; };