smc_cet_otherincome_backend/app/routes/routes.js
2022-06-24 12:20:19 +05:30

90 lines
1.7 KiB
JavaScript

module.exports = app => {
const request = require("request");
const cors=require('cors');
const IncomeController = require("../controllers/other.income.controller.js");
const { logMsg } = require('../services/logger.js');
var router = require("express").Router();
/**
* @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: 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
* childData:
* type: array
* description:
* example:
* updatedby:
* type: integer
* description:
* example: 003
*/
/**
* @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);
// routes started here
app.use('/api', router);
};