create(table) {
        if (table instanceof Table) {
            utils.logdebug(`** Generating Controller for table ${table.name}`);
            if (!this.database)
                this.database = table.database;
            this.controllers[table.name] = {
                table: table,
                getAll: (req,res) => table.model.findAll({where: DynamicControllers.getRequestCondition(table,CONF.METHOD.GET_ALL,req)})
                    .then(records => res.status(200).send(records))
                    .catch(error => res.status(400).send({error: error})),

                getOne: (req,res) => table.model.findAll({where: DynamicControllers.getRequestCondition(table,CONF.METHOD.GET_ONE,req)})
                    .then(records => res.status(200).send(records))
                    .catch(error => res.status(404).send({error: error})),

                addOne: (req,res) => table.model.create(req.body)
                    .then(records => res.status(201).send({affected: records}))
                    .catch(error => res.status(400).send({affected: 0,error: error})),

                modifyOne: (req,res) => table.model.update(req.body,{where: DynamicControllers.getRequestCondition(table,CONF.METHOD.PUT,req)})
                    .then(records => res.status(200).send({affected: records}))
                    .catch(error => res.status(400).send({affected: 0,error: error})),

                deleteOne: (req,res) => table.model.destroy({where: DynamicControllers.getRequestCondition(table,CONF.METHOD.DELETE,req)})
                    .then(records => res.status(200).send({affected: records}))
                    .catch(error => res.status(400).send({affected: 0,error: error}))
            }
            utils.logdebug(`** OK - Generated Controller for table ${table.name}`);
            return this;
        } else {
            console.error(`Failed generating Controller for table ${table.name}`);
            return null;
        }
    }
/**
     * Async method to create and push controller for one table / model
     * Provides each controller with methods: getAll, getOne, addOne, 
     * modifyOne and deleteOne
     * @param {Table} table 
     * @returns 
     */
Async method to create and push controller for one table / model
Provides each controller with methods: getAll, getOne, addOne,
modifyOne and deleteOne
@param {Table} table
@returns
Async method to create and push controller for one table / model Provides each controller with methods : getAll getOne addOne modifyOne and deleteOne @param { Table } table @returns
create(table) {
        if (table instanceof Table) {
            utils.logdebug(`** Generating Controller for table ${table.name}`);
            if (!this.database)
                this.database = table.database;
            this.controllers[table.name] = {
                table: table,
                getAll: (req,res) => table.model.findAll({where: DynamicControllers.getRequestCondition(table,CONF.METHOD.GET_ALL,req)})
                    .then(records => res.status(200).send(records))
                    .catch(error => res.status(400).send({error: error})),
                getOne: (req,res) => table.model.findAll({where: DynamicControllers.getRequestCondition(table,CONF.METHOD.GET_ONE,req)})
                    .then(records => res.status(200).send(records))
                    .catch(error => res.status(404).send({error: error})),
                addOne: (req,res) => table.model.create(req.body)
                    .then(records => res.status(201).send({affected: records}))
                    .catch(error => res.status(400).send({affected: 0,error: error})),
                modifyOne: (req,res) => table.model.update(req.body,{where: DynamicControllers.getRequestCondition(table,CONF.METHOD.PUT,req)})
                    .then(records => res.status(200).send({affected: records}))
                    .catch(error => res.status(400).send({affected: 0,error: error})),
                deleteOne: (req,res) => table.model.destroy({where: DynamicControllers.getRequestCondition(table,CONF.METHOD.DELETE,req)})
                    .then(records => res.status(200).send({affected: records}))
                    .catch(error => res.status(400).send({affected: 0,error: error}))
            }
            utils.logdebug(`** OK - Generated Controller for table ${table.name}`);
            return this;
        } else {
            console.error(`Failed generating Controller for table ${table.name}`);
            return null;
        }
    }
create ( table ) { if ( table instanceof Table ) { utils . logdebug ( ` ${ table . name } ` ) ; if ( ! this . database ) this . database = table . database ; this . controllers [ table . name ] = { table : table , getAll : ( req , res ) => table . model . findAll ( { where : DynamicControllers . getRequestCondition ( table , CONF . METHOD . GET_ALL , req ) } ) . then ( records => res . status ( 200 ) . send ( records ) ) . catch ( error => res . status ( 400 ) . send ( { error : error } ) ) , getOne : ( req , res ) => table . model . findAll ( { where : DynamicControllers . getRequestCondition ( table , CONF . METHOD . GET_ONE , req ) } ) . then ( records => res . status ( 200 ) . send ( records ) ) . catch ( error => res . status ( 404 ) . send ( { error : error } ) ) , addOne : ( req , res ) => table . model . create ( req . body ) . then ( records => res . status ( 201 ) . send ( { affected : records } ) ) . catch ( error => res . status ( 400 ) . send ( { affected : 0 , error : error } ) ) , modifyOne : ( req , res ) => table . model . update ( req . body , { where : DynamicControllers . getRequestCondition ( table , CONF . METHOD . PUT , req ) } ) . then ( records => res . status ( 200 ) . send ( { affected : records } ) ) . catch ( error => res . status ( 400 ) . send ( { affected : 0 , error : error } ) ) , deleteOne : ( req , res ) => table . model . destroy ( { where : DynamicControllers . getRequestCondition ( table , CONF . METHOD . DELETE , req ) } ) . then ( records => res . status ( 200 ) . send ( { affected : records } ) ) . catch ( error => res . status ( 400 ) . send ( { affected : 0 , error : error } ) ) } utils . logdebug ( ` ${ table . name } ` ) ; return this ; } else { console . error ( ` ${ table . name } ` ) ; return null ; } }
Async method to create and push controller for one table / model
 Provides each controller with methods: getAll, getOne, addOne,
 modifyOne and deleteOne
 @param {Table} table
 @returns
Async method to create and push controller for one table / model Provides each controller with methods : getAll getOne addOne modifyOne and deleteOne @param { Table } table @returns