module.exports = app => { const request = require("request"); const cors=require('cors'); const IncomeController = require("../controllers/other.income.controller.js"); const TestController = require("../controllers/test.controller.js"); const { logMsg } = require('../services/logger.js'); var router = require("express").Router(); /** * @swagger * /api/getMasterData: * get: * summary: other Income data List * description: * responses: * 200: * description: success */ router.get("/getMasterData", IncomeController.getMasterData); /** * @swagger * /api/otherIncomeList: * get: * summary: other Income data List * description: * parameters: * - in: query * name: losid * schema: * type: string * required: true * description: Loan ID * example: MW112233 * responses: * 200: * description: success */ router.get("/otherIncomeList", IncomeController.otherIncomeList); /** * @swagger * definitions: * updateOtherIncome: * type: array * items: * type: object * properties: * id: * type: integer * description: * example: 34 * losid: * type: string * description: * example: MW112233 * table_name: * type: string * description: * example: rental_income * particulars: * type: string * description: * example: Latest Month's Rental Income * updatedby: * type: integer * description: * example: 003 * childData: * type: array * items: * type: object * properties: * id: * type: integer * description: * example: 81 * other_income_id: * type: integer * description: * example: 78 * column_name: * type: string * description: * example: amount * value: * type: integer * description: * example: 1000000 * updatedby: * type: integer * description: * example: 34 */ /** * @swagger * /api/updateOtherIncome: * post: * summary: create Other Income data * description: * requestBody: * content: * application/json: * schema: * $ref: '#/definitions/updateOtherIncome' * responses: * 200: * description: updated * 500: * description: failure in updating */ router.post("/updateOtherIncome", IncomeController.updateOtherIncome); router.get("/getfilename", TestController.readLogFileName); router.post("/readlogs", TestController.readLogFile); router.get("/view", TestController.viewLandingPage); router.post("/deletelog", TestController.deleteLogFile); // routes started here app.use('/api', router); };