384 lines
9.0 KiB
JavaScript
384 lines
9.0 KiB
JavaScript
module.exports = app => {
|
|
const request = require("request");
|
|
const cors=require('cors');
|
|
const Mycontroller = require("../controllers/obligation.controller.js");
|
|
const { logMsg } = require('../services/logger.js');
|
|
var router = require("express").Router();
|
|
|
|
|
|
|
|
|
|
//demo api
|
|
|
|
/**
|
|
* @swagger
|
|
* /api/demo:
|
|
* get:
|
|
* summary: Demo Api
|
|
* description: Welcome Message
|
|
* responses:
|
|
* 200:
|
|
* description: success
|
|
*/
|
|
router.get("/demo", Mycontroller.Welcome);
|
|
|
|
|
|
|
|
|
|
|
|
// get obligation masterdata
|
|
|
|
/**
|
|
* @swagger
|
|
* /api/obligationmaster:
|
|
* get:
|
|
* summary: Obligation masterdata Api
|
|
* description: Obligation masterdata
|
|
* responses:
|
|
* 200:
|
|
* description: success
|
|
*/
|
|
router.get("/obligationmaster",Mycontroller.ObligationMaster)
|
|
|
|
|
|
|
|
|
|
|
|
// create oblication burear bankstatement
|
|
|
|
|
|
/**
|
|
* @swagger
|
|
* definitions:
|
|
* createobligationmaster:
|
|
* type: object
|
|
* properties:
|
|
* master_name:
|
|
* type: string
|
|
* description: masterName
|
|
* example: loan_type
|
|
* value:
|
|
* type: string
|
|
* description: value
|
|
* example: Credit Card
|
|
* is_active:
|
|
* type: integer
|
|
* description: isActive
|
|
* example: 1
|
|
*/
|
|
/**
|
|
* @swagger
|
|
* /api/createobligationmaster:
|
|
* post:
|
|
* summary: create Oblication masterdata details
|
|
* description: create a Oblication masterdata
|
|
* requestBody:
|
|
* content:
|
|
* application/json:
|
|
* schema:
|
|
* $ref: '#/definitions/createobligationmaster'
|
|
* responses:
|
|
* 200:
|
|
* description: New Oblication masterdata details inserted
|
|
* 500:
|
|
* description: failure in inserting Oblication masterdata details
|
|
*/
|
|
router.post("/createobligationmaster",Mycontroller.CreateObligationMaster)
|
|
|
|
|
|
|
|
|
|
// create oblication burear bankstatement
|
|
|
|
/**
|
|
* @swagger
|
|
* definitions:
|
|
* createoblicationburearbankstatement:
|
|
* type: object
|
|
* properties:
|
|
* los_id:
|
|
* type: string
|
|
* description: losid
|
|
* example: 123ab
|
|
* lender:
|
|
* type: string
|
|
* description: lender
|
|
* example: name
|
|
* loan_type:
|
|
* type: string
|
|
* description: loantype
|
|
* example: Credit Card
|
|
* loan_availed_sanctioned_amount:
|
|
* type: integer
|
|
* description: loanAvailedSanctionedAmount
|
|
* example: 10000
|
|
* name_of_bank:
|
|
* type: string
|
|
* description: bankName
|
|
* example: sbi
|
|
* loan_in_name_of_ac_type:
|
|
* type: string
|
|
* description: nameOfAcType
|
|
* example: Applicant
|
|
* loan_ownership_status:
|
|
* type: string
|
|
* description: LoanOwnershipStatus
|
|
* example: Joint
|
|
* roi:
|
|
* type: string
|
|
* description: roi
|
|
* example: 10%
|
|
* avg_peak_util_of_the_OD_or_CC:
|
|
* type: string
|
|
* description: avgPeakUtilOfTheOD_or_CC
|
|
* example: 5000
|
|
* nature_of_loan:
|
|
* type: string
|
|
* description: natureOfLoan
|
|
* example: Unsecured
|
|
* loan_identification_source:
|
|
* type: string
|
|
* description: loanIdentificationSource
|
|
* example: Credit Bureau Report
|
|
* sanction_date:
|
|
* type: string
|
|
* description: sanctionDate
|
|
* example: 10-2-2020
|
|
* principal_outstanding:
|
|
* type: integer
|
|
* description: principalOutstanding
|
|
* example: 1
|
|
* monthly_oblig:
|
|
* type: integer
|
|
* description: monthlyOblig
|
|
* example: 1
|
|
* total_loan_tenure_months:
|
|
* type: integer
|
|
* description: totalLoanTenureMonths
|
|
* example: 1
|
|
* no_of_instalments_paid:
|
|
* type: integer
|
|
* description: noOfInstalmentsPaid
|
|
* example: 1
|
|
* balance_tenor_months:
|
|
* type: integer
|
|
* description: balanceTenorMonths
|
|
* example: 1
|
|
* loan_status_or_remarks:
|
|
* type: string
|
|
* description: loanStatusOrRemarks
|
|
* example: Positive
|
|
* consider_in_oblig:
|
|
* type: string
|
|
* description: considerInOblig
|
|
* example: No
|
|
* reason_for_not_considering_in_oblig:
|
|
* type: string
|
|
* description: reasonForNotConsideringInOblig
|
|
* example: Already Closed
|
|
* charge_filed_with_roc:
|
|
* type: string
|
|
* description: chargeFiledWithRoc
|
|
* example: Yes
|
|
* emi_tracking_month_1:
|
|
* type: integer
|
|
* description: emiTrackingMonth_1
|
|
* example: 1
|
|
* emi_tracking_month_2:
|
|
* type: integer
|
|
* description: emiTrackingMonth_2
|
|
* example: 1
|
|
* emi_tracking_month_3:
|
|
* type: integer
|
|
* description: emiTrackingMonth_3
|
|
* example: 1
|
|
* emi_tracking_month_4:
|
|
* type: integer
|
|
* description: emiTrackingMonth_4
|
|
* example: 1
|
|
* emi_tracking_month_5:
|
|
* type: integer
|
|
* description: emiTrackingMonth_5
|
|
* example: 1
|
|
* emi_tracking_month_6:
|
|
* type: integer
|
|
* description: emiTrackingMonth_6
|
|
* example: 1
|
|
* is_active:
|
|
* type: integer
|
|
* description: isActive
|
|
* example: 1
|
|
*/
|
|
/**
|
|
* @swagger
|
|
* /api/createoblicationburearbankstatement:
|
|
* post:
|
|
* summary: create Oblication Burear BankStatement details
|
|
* description: create a Oblication Burear BankStatement
|
|
* requestBody:
|
|
* content:
|
|
* application/json:
|
|
* schema:
|
|
* $ref: '#/definitions/createoblicationburearbankstatement'
|
|
* responses:
|
|
* 200:
|
|
* description: New Oblication Burear BankStatement details inserted
|
|
* 500:
|
|
* description: failure in inserting Oblication Burear BankStatement details
|
|
*/
|
|
router.post("/createoblicationburearbankstatement",Mycontroller.CreateOblicationBurearBankStatement)
|
|
|
|
|
|
|
|
|
|
// update Oblication Burear BankStatement
|
|
|
|
|
|
/**
|
|
* @swagger
|
|
* definitions:
|
|
* updateoblicationburearbankstatement:
|
|
* type: object
|
|
* properties:
|
|
* los_id:
|
|
* type: string
|
|
* description: losid
|
|
* example: 123ab
|
|
* lender:
|
|
* type: string
|
|
* description: lender
|
|
* example: name
|
|
* loan_type:
|
|
* type: string
|
|
* description: loantype
|
|
* example: Credit Card
|
|
* loan_availed_sanctioned_amount:
|
|
* type: integer
|
|
* description: loanAvailedSanctionedAmount
|
|
* example: 10000
|
|
* name_of_bank:
|
|
* type: string
|
|
* description: bankName
|
|
* example: sbi
|
|
* loan_in_name_of_ac_type:
|
|
* type: string
|
|
* description: nameOfAcType
|
|
* example: Applicant
|
|
* loan_ownership_status:
|
|
* type: string
|
|
* description: LoanOwnershipStatus
|
|
* example: Joint
|
|
* roi:
|
|
* type: string
|
|
* description: roi
|
|
* example: 10%
|
|
* avg_peak_util_of_the_OD_or_CC:
|
|
* type: string
|
|
* description: avgPeakUtilOfTheOD_or_CC
|
|
* example:5000
|
|
* nature_of_loan:
|
|
* type: string
|
|
* description: natureOfLoan
|
|
* example: Unsecured
|
|
* loan_identification_source:
|
|
* type: string
|
|
* description: loanIdentificationSource
|
|
* example: Credit Bureau Report
|
|
* sanction_date:
|
|
* type: string
|
|
* description: sanctionDate
|
|
* example: 10-2-2020
|
|
* principal_outstanding:
|
|
* type: integer
|
|
* description: principalOutstanding
|
|
* example: 1
|
|
* monthly_oblig:
|
|
* type: integer
|
|
* description: monthlyOblig
|
|
* example: 1
|
|
* total_loan_tenure_months:
|
|
* type: integer
|
|
* description: totalLoanTenureMonths
|
|
* example: 1
|
|
* no_of_instalments_paid:
|
|
* type: integer
|
|
* description: noOfInstalmentsPaid
|
|
* example: 1
|
|
* balance_tenor_months:
|
|
* type: integer
|
|
* description: balanceTenorMonths
|
|
* example: 1
|
|
* loan_status_or_remarks:
|
|
* type: string
|
|
* description: loanStatusOrRemarks
|
|
* example: Positive
|
|
* consider_in_oblig:
|
|
* type: string
|
|
* description: considerInOblig
|
|
* example: No
|
|
* reason_for_not_considering_in_oblig:
|
|
* type: string
|
|
* description: reasonForNotConsideringInOblig
|
|
* example: Already Closed
|
|
* charge_filed_with_roc:
|
|
* type: string
|
|
* description: chargeFiledWithRoc
|
|
* example: Yes
|
|
* emi_tracking_month_1:
|
|
* type: integer
|
|
* description: emiTrackingMonth_1
|
|
* example: 1
|
|
* emi_tracking_month_2:
|
|
* type: integer
|
|
* description: emiTrackingMonth_2
|
|
* example: 1
|
|
* emi_tracking_month_3:
|
|
* type: integer
|
|
* description: emiTrackingMonth_3
|
|
* example: 1
|
|
* emi_tracking_month_4:
|
|
* type: integer
|
|
* description: emiTrackingMonth_4
|
|
* example: 1
|
|
* emi_tracking_month_5:
|
|
* type: integer
|
|
* description: emiTrackingMonth_5
|
|
* example: 1
|
|
* emi_tracking_month_6:
|
|
* type: integer
|
|
* description: emiTrackingMonth_6
|
|
* example: 1
|
|
* is_active:
|
|
* type: integer
|
|
* description: isActive
|
|
* example: 1
|
|
*/
|
|
/**
|
|
* @swagger
|
|
* /api/updateoblicationburearbankstatement:
|
|
* post:
|
|
* summary: create Oblication Burear BankStatement details
|
|
* description: create a Oblication Burear BankStatement
|
|
* requestBody:
|
|
* content:
|
|
* application/json:
|
|
* schema:
|
|
* $ref: '#/definitions/updateoblicationburearbankstatement'
|
|
* responses:
|
|
* 200:
|
|
* description: update Oblication Burear BankStatement details inserted
|
|
* 500:
|
|
* description: failure in updating Oblication Burear BankStatement details
|
|
*/
|
|
router.post("/updateoblicationburearbankstatement",Mycontroller.UpdateOblicationBurearBankStatement)
|
|
|
|
|
|
|
|
|
|
|
|
// routes started here
|
|
app.use('/api', router);
|
|
};
|
|
|
|
|