module.exports = function (pName, pLabel, pIcon, pDesc) { return { name: pName, label: pLabel || pName, icon: pIcon || 'mdi-hexagon', description: pDesc || '---', /** MongoDB indexes - format: {keys:, options:} */ indexes: [], /** JSON Schema */ schema: {}, hooks: { read: { before: (pCtx, next) => { next() }, after: (pCtx, docs, next) => { next() } }, readOne: { before: (pCtx, id, next) => { next() }, after: (pCtx, doc, next) => { next() } }, update: { before: (pCtx, id, doc, origin, next) => { next() }, after: (pCtx, doc, origin, next) => { next() } }, create: { before: (pCtx, doc, next) => { next() }, after: (pCtx, doc, next) => { next() } }, delete: { before: (pCtx, id, next) => { next() }, after: (pCtx, ok, next) => { next() } } }, tools: {}, /** Db handler of collection */ __db: null, __services: { read: function (pArgs, pCallback) { pCallback() }, readOne: function (pId, pArgs, pCallback) { pCallback() }, create: function (pDoc, pUser, pCallback) { pCallback() }, update: function (pId, pDoc, pUser, pCallback) { pCallback() }, delete: function (pId, pUser, pCallback) { pCallback() } }, __internal: { router: require('express').Router(), addRoute: function (pMethod, pUrl, pFunc) { this.router[pMethod.toLowerCase()](pUrl, pFunc) } } } }