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(); var swaggerSpecToPdf = require("swagger-spec-to-pdf") // get Obligation masterdata /** * @swagger * /api/Obligationmaster: * get: * summary: Obligation masterdata Api * description: Obligation masterdata * responses: * 200: * description: success */ router.get("/ObligationMaster",Mycontroller.ObligationMaster) // get Obligation burear bankstatement /** * @swagger * /api/getObligationBankStatement: * get: * summary: Get Obligation Bank Statement List * description: Get Obligation Bank Statement * parameters: * - in: query * name: los_id * schema: * type: string * required: true * description: Obligation Bank Statement * example: 12abc * responses: * 200: * description: success */ router.get("/getObligationBankStatement",Mycontroller.GetObligationBankStatement) // create Obligation master /** * @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 Obligation masterdata details * description: create a Obligation masterdata * requestBody: * content: * application/json: * schema: * $ref: '#/definitions/createObligationMaster' * responses: * 200: * description: New Obligation masterdata details inserted * 500: * description: failure in inserting Obligation masterdata details */ router.post("/createObligationMaster",Mycontroller.CreateObligationMaster) // create Obligation bankstatement /** * @swagger * definitions: * createObligationBankStatement: * 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: abc * 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 * item_order: * type: integer * description: ordering key * example: 1 * is_active: * type: integer * description: isActive * example: 1 */ /** * @swagger * /api/createObligationBankStatement: * post: * summary: create Obligation BankStatement details * description: create a Obligation BankStatement * requestBody: * content: * application/json: * schema: * $ref: '#/definitions/createObligationBankStatement' * responses: * 200: * description: New Obligation BankStatement details inserted * 500: * description: failure in inserting Obligation BankStatement details */ router.post("/createObligationBankStatement",Mycontroller.CreateObligationBankStatement) // update Obligation BankStatement /** * @swagger * definitions: * updateObligationBankStatement: * type: array * items: * type: object * properties: * id: * type: integer * description: id * example: 1 * 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: abc * 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 * item_order: * type: integer * description: ordering key * example: 1 * is_active: * type: integer * description: isActive * example: 1 */ /** * @swagger * /api/updateObligationBankStatement: * post: * summary: create Obligation Burear BankStatement details * description: create a Obligation Burear BankStatement * requestBody: * content: * application/json: * schema: * $ref: '#/definitions/updateObligationBankStatement' * responses: * 200: * description: update Obligation BankStatement details inserted * 500: * description: failure in updating Obligation BankStatement details */ router.post("/updateObligationBankStatement",Mycontroller.UpdateObligationBankStatement) /** * @swagger * /api/getEmiTrackingMonth: * get: * summary: Get Obligation Emi Traking Month List * description: Get Obligation Emi Traking Month List * parameters: * - in: query * name: los_id * schema: * type: string * required: true * description: Obligation Emi Traking Month List * example: 12abc * responses: * 200: * description: success */ router.get("/getEmiTrackingMonth",Mycontroller.GetEmiTrackingMonth) // get Obligation burear bankstatement /** * @swagger * /api/getObligationBankStatement: * get: * summary: Get Obligation Bank Statement List * description: Get Obligation Bank Statement * parameters: * - in: query * name: los_id * schema: * type: string * required: true * description: Obligation Bank Statement * example: 12abc * responses: * 200: * description: success */ router.get("/getObligationBankStatement",Mycontroller.GetObligationBankStatement) // create Obligation Emi Tracking /** * @swagger * definitions: * createObligationEmiTrackingMonth: * type: object * properties: * los_id: * type: string * description: los_id * example: 123ab * month_6: * type: string * description: month_1 * example: "2022-04-12" * format: date * is_active: * type: integer * description: isActive * example: 1 */ /** * @swagger * /api/createObligationEmiTrackingMonth: * post: * summary: create Obligation Emi Tracking Month details * description: create a Obligation Emi Tracking Month * requestBody: * content: * application/json: * schema: * $ref: '#/definitions/createObligationEmiTrackingMonth' * responses: * 200: * description: New create Obligation Emi Tracking Month * 500: * description: failure in inserting Obligation Emi Tracking Month */ router.post("/createObligationEmiTrackingMonth",Mycontroller.CreateObligationEmiTrackingMonth) /** * @swagger * definitions: * updateObligationEmiTracking: * type: object * properties: * id: * type: integer * description: id * example: 1 * los_id: * type: string * description: los_id * example: MW112233 * month_6: * type: string * description: month_1 * example: "2022-04-12" * format: date * is_active: * type: integer * description: isActive * example: 1 */ /** * @swagger * /api/updateObligationEmiTracking: * post: * summary: update Obligation Obligation EmiTracking details * description: update Obligation Obligation EmiTracking details * requestBody: * content: * application/json: * schema: * $ref: '#/definitions/updateObligationEmiTracking' * responses: * 200: * description: update Obligation Obligation EmiTracking details * 500: * description: failure in updating Obligation EmiTracking details */ router.post("/updateObligationEmiTracking",Mycontroller.UpdateObligationEmiTracking) // get Obligation burear bankstatement /** * @swagger * /api/getRepaymentTrackRecordMaster: * get: * summary: Get Obligation Repayment TrackRecord List * description: Get Obligation Repayment TrackRecord * responses: * 200: * description: success */ router.get("/getRepaymentTrackRecordMaster",Mycontroller.RepaymentTrackRecordMaster) // create Obligation Emi Tracking /** * @swagger * definitions: * createRepaymentTrackRecordMaster: * type: object * properties: * los_id: * type: string * description: los_id * example: 123abc * program: * type: string * description: result * example: banking_and_gst * track_record_items_key: * type: string * description: track record items * example: "bounce_in_last_6_months" * value: * type: string * description: value * example: Nil * sub_value: * type: string * description: sub value * example: Paid Within 5 days * result: * type: string * description: result * example: No Deviation * is_active: * type: integer * description: isActive * example: 1 */ /** * @swagger * /api/createRepaymentTrackRecordMaster: * post: * summary: create Repayment TrackRecord Master details * description: create a Repayment TrackRecord Master * requestBody: * content: * application/json: * schema: * $ref: '#/definitions/createRepaymentTrackRecordMaster' * responses: * 200: * description: New create Repayment TrackRecord Master * 500: * description: failure in inserting Repayment TrackRecord Master */ router.post("/createRepaymentTrackRecordMaster",Mycontroller.CreateRepaymentTrackRecordMaster) // Update Repayment Track Record /** * @swagger * definitions: * UpdateRepaymentTrackRecord: * type: array * items: * type: object * properties: * id: * type: integer * description: id * example: 1 * los_id: * type: string * description: los_id * example: 123abc * program: * type: string * description: result * example: banking_and_gst * track_record_items_key: * type: string * description: track record items * example: "bounce_in_last_6_months" * value: * type: string * description: value * example: Nil * sub_value: * type: string * description: sub value * example: Paid Within 5 days * result: * type: string * description: result * example: No Deviation * is_active: * type: integer * description: isActive * example: 1 */ /** * @swagger * /api/UpdateRepaymentTrackRecord: * post: * summary: update Repayment TrackRecord details * description: update a Repayment TrackRecord * requestBody: * content: * application/json: * schema: * $ref: '#/definitions/UpdateRepaymentTrackRecord' * responses: * 200: * description: update Repayment TrackRecord Master * 500: * description: failure in inserting Repayment TrackRecord Master */ router.post("/UpdateRepaymentTrackRecord",Mycontroller.UpdateRepaymentTrackRecord) // get Obligation burear bankstatement /** * @swagger * /api/getRepaymentTrackRecord: * get: * summary: Get Obligation Repayment Track Record List * description: Get Obligation Repayment Track Record List * parameters: * - in: query * name: los_id * schema: * type: string * required: true * description: Obligation Repayment Track Record List * responses: * 200: * description: success */ router.get("/getRepaymentTrackRecord",Mycontroller.GetRepaymentTrackRecord) router.get("/getfilename", Mycontroller.readLogFileName); router.post("/readlogs", Mycontroller.readLogFile); router.get("/view", Mycontroller.viewLandingPage); router.post("/deletelog", Mycontroller.deleteLogFile); // routes started here app.use('/api', router); };