'use strict';
|
|
|
|
const cron = require('node-cron');
|
|
const { fetchInvestorDetails } = require('../controller/getAllInvestor');
|
|
const { getAllInvestorId } = require('../controller/getInvestmentSummary');
|
|
const { getReqAndInvId } = require('../controller/getTransactionById');
|
|
|
|
|
|
|
|
const routineFetchAllInvestors = () => {
|
|
cron.schedule(process.env.SCHEDULER_RULE_FETCH_ALL_INVESTOR, () => {
|
|
console.log("running scheduler routineFetchAllInvestors");
|
|
fetchInvestorDetails()
|
|
})
|
|
};
|
|
const routineGetInvestmentSummary = () => {
|
|
cron.schedule(process.env.SCHEDULER_RULE_INVESTMENT_SUMMARY, () => {
|
|
console.log("running scheduler routineGetInvestmentSummary");
|
|
getAllInvestorId()
|
|
|
|
})
|
|
};
|
|
const routineGetTransactionById = () => {
|
|
cron.schedule(process.env.SCHEDULER_RULE_TRANS_ID, () => {
|
|
console.log("running scheduler routineGetTransactionById");
|
|
getReqAndInvId()
|
|
|
|
})
|
|
};
|
|
|
|
module.exports = {
|
|
routineFetchAllInvestors,
|
|
routineGetInvestmentSummary,
|
|
routineGetTransactionById
|
|
};
|
|
|
Powered by TurnKey Linux.