diff --git a/server/index.js b/server/index.js index 1334084..c0032df 100644 --- a/server/index.js +++ b/server/index.js @@ -109,5 +109,25 @@ if (process.env.NODE_ENV.toUpperCase() == "PRODUCTION") { } }); } + // cash in + const { + _generateCashIn, + } = require("../application/modules/cashin/cahsin.controller"); + + cron.schedule('* * * * *', async () => { + try { + let uniqueCode = helper.getUniqueCode(); + winston.logger.info(`STARTING SCHEDULER-FB70 GENERATE CASH IN ${uniqueCode}`); + const posting = await _generateCashIn(uniqueCode); + winston.logger.info( + `END SCHEDULER-FB70 GENERATE CASH IN : ${JSON.stringify(posting)}` + ); + } catch (error) { + // create log + winston.logger.error( + `500 internal server error - backend server | ${error.message}` + ); + } + }); module.exports = app;