gopi:log
This commit is contained in:
commit
4101400533
@ -1,8 +1,8 @@
|
|||||||
//const db = require("../models");
|
//const db = require("../models");
|
||||||
//const Entities = db.tutorials;
|
//const Entities = db.tutorials;
|
||||||
//const Op = db.Sequelize.Op;
|
const { Op } = require("sequelize");
|
||||||
|
|
||||||
const { sequelize, Entities , Financials , Statementsmaster ,Sectionsmaster , Subsectionsmaster } = require('../models')
|
const { sequelize, Entities , Financials , Statementsmaster ,Sectionsmaster , Subsectionsmaster , Brokenperiods } = require('../models')
|
||||||
const { logMsg } = require('../services/logger.js');
|
const { logMsg } = require('../services/logger.js');
|
||||||
|
|
||||||
|
|
||||||
@ -14,18 +14,24 @@ exports.MenuList = async (req, res) => {
|
|||||||
const losid = req.params.losid
|
const losid = req.params.losid
|
||||||
const MasterData = await Statementsmaster.findAll({
|
const MasterData = await Statementsmaster.findAll({
|
||||||
where :{is_active : 1} ,
|
where :{is_active : 1} ,
|
||||||
|
attributes: ['id', 'statement', 'is_active'],
|
||||||
include :[{
|
include :[{
|
||||||
association: 'sectionsmasterData' ,
|
association: 'sectionsmasterData' ,
|
||||||
where :{is_active : 1} ,
|
where :{is_active : 1} ,
|
||||||
|
attributes: ['id', 'section', 'is_active'],
|
||||||
include :[{
|
include :[{
|
||||||
association: 'subsectionsmasterData' ,
|
association: 'subsectionsmasterData' ,
|
||||||
//where :{is_active : 1}
|
where :{is_active : 1} ,
|
||||||
}]
|
attributes: ['id', 'subsection', 'is_active'],
|
||||||
}]
|
required :false
|
||||||
|
}],
|
||||||
|
required :false
|
||||||
|
}],
|
||||||
|
required :false
|
||||||
|
|
||||||
});
|
});
|
||||||
// const count = MasterData.length;
|
|
||||||
// console.log(count)
|
const EntitiesData = await Entities.findAll({where : { losid } , attributes: ['id', 'losid' , 'pan' , 'cin' , 'bizname'] });
|
||||||
const EntitiesData = await Entities.findAll({where : { losid } });
|
|
||||||
let data = [];
|
let data = [];
|
||||||
EntitiesData.forEach((value, key)=>{
|
EntitiesData.forEach((value, key)=>{
|
||||||
obj_data = { ...value.dataValues , statementsmasterrData:MasterData}
|
obj_data = { ...value.dataValues , statementsmasterrData:MasterData}
|
||||||
@ -40,30 +46,29 @@ exports.MenuList = async (req, res) => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
// Retrieve all Entities from the database.
|
|
||||||
exports.findAllEntities = (req, res) => {
|
|
||||||
|
|
||||||
Entities.findAll()
|
// FinantialsSummary
|
||||||
|
exports.FinantialsSummary = async (req, res) => {
|
||||||
|
const id = req.params.id
|
||||||
|
|
||||||
|
Financials.findAll({where : { entity_id : id } ,attributes: ['fy'], group: ['fy'] , order: [['fy', 'ASC']] })
|
||||||
.then(data => {
|
.then(data => {
|
||||||
res.send({'status':200,'message':"success",'data':data});
|
// console.log(data.length)
|
||||||
|
if(data.length == 3)
|
||||||
logMsg.info("Success :"(data));
|
{
|
||||||
})
|
const Year_1 = data[0].dataValues.fy
|
||||||
.catch(err => {
|
const Year_2 = data[1].dataValues.fy
|
||||||
res.status(500).send({
|
const Year_3 = data[2].dataValues.fy
|
||||||
message:
|
//sequelize.query("Select a.entity_id,a.itemid,e.statement as statement_id ,e.section as section_id ,e.itemtext as items , a.value as fy_"+Year_1+" , b.value fy_"+Year_2+" , c.value fy_"+Year_3+" FROM financials a JOIN ( SELECT id,statement,section, itemtext FROM itemsmaster) e ON a.itemid = e.id JOIN ( SELECT entity_id, itemid, value, fy FROM financials WHERE fy = "+Year_3+") c ON a.entity_id = c.entity_id and a.itemid = c.itemid JOIN ( SELECT entity_id, itemid, value, fy FROM financials WHERE fy = "+Year_2+") b ON a.entity_id = b.entity_id and a.itemid = b.itemid AND a.fy = "+Year_1+" WHERE a.entity_id = "+id)
|
||||||
err.message || "Some error occurred while retrieving tutorials."
|
sequelize.query("Select a.entity_id,x.id as statement_id,x.statement as statement,y.id as section_id,y.section as section,a.itemid,e.itemtext as items,a.value as fy_"+Year_1+",b.value fy_"+Year_2+",c.value fy_"+Year_3+" FROM financials a JOIN ( SELECT id, itemtext ,statement FROM itemsmaster ) e ON a.itemid = e.id JOIN ( SELECT id, statement FROM statementsmaster ) x ON e.statement = x.id JOIN ( SELECT id, section FROM sectionsmaster ) y ON e.statement = y.id JOIN ( SELECT entity_id, itemid, value, fy FROM financials WHERE fy = "+Year_3+") c ON a.entity_id = c.entity_id and a.itemid = c.itemid JOIN ( SELECT entity_id, itemid, value, fy FROM financials WHERE fy = "+Year_2+") b ON a.entity_id = b.entity_id and a.itemid = b.itemid AND a.fy = "+Year_1+" WHERE a.entity_id = "+id+" order by x.id asc , y.id asc , a.itemid asc ")
|
||||||
|
.then(result => {
|
||||||
|
res.send({'status':200,'message':"success",'data':result});
|
||||||
|
}).catch(err => {
|
||||||
|
res.status(500).send({'status':404,
|
||||||
|
message: err.message || "Some error occurred while retrieving tutorials." ,'data': "No data" });
|
||||||
});
|
});
|
||||||
});
|
} else { res.send({'status':404,'message':"failed",'data':"No data"}); }
|
||||||
};
|
|
||||||
|
|
||||||
// Retrieve all Statment from the database.
|
|
||||||
exports.StatmentList = (req, res) => {
|
|
||||||
|
|
||||||
Statementsmaster.findAll({include: 'sectionsmasterData' })
|
|
||||||
.then(data => {
|
|
||||||
res.send({'status':200,'message':"success",'data':data});
|
|
||||||
logMsg.info("Success :"(data));
|
|
||||||
})
|
})
|
||||||
.catch(err => {
|
.catch(err => {
|
||||||
res.status(500).send({'status':404,
|
res.status(500).send({'status':404,
|
||||||
@ -71,19 +76,73 @@ exports.StatmentList = (req, res) => {
|
|||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
exports.test = (req, res) => {
|
// Broken period list api
|
||||||
sequelize.query("select * from statementsmaster")
|
exports.BrokenPeriodsList = (req, res) => {
|
||||||
|
const entityid = req.params.entityid
|
||||||
|
Brokenperiods.findAll({where : { entity_id : entityid } })
|
||||||
.then(data => {
|
.then(data => {
|
||||||
res.send({'status':200,'message':"success",'data':data});
|
res.send({'status':200,'message':"success",'data':data});
|
||||||
logMsg.info("Success :"(data));
|
logMsg.info("Success :"(data));
|
||||||
})
|
})
|
||||||
.catch(err => {
|
.catch(err => {
|
||||||
res.status(500).send({
|
res.status(404).send({'status':404,
|
||||||
message:
|
message: err.message || "Some error occurred while retrieving statements." ,'data': "No data" });
|
||||||
err.message || "Some error occurred while retrieving tutorials."
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
// Broken period Insert OR Update
|
||||||
|
exports.BrokenPeriods = (req, res) => {
|
||||||
|
const obj = req.body
|
||||||
|
if (obj.hasOwnProperty("id"))
|
||||||
|
{
|
||||||
|
// update broken periods
|
||||||
|
const Id = req.body.id
|
||||||
|
Brokenperiods.update( {
|
||||||
|
entity_id: req.body.entity_id,
|
||||||
|
from: req.body.from,
|
||||||
|
to: req.body.to,
|
||||||
|
months: req.body.months,
|
||||||
|
cy: req.body.cy,
|
||||||
|
py: req.body.py,
|
||||||
|
variation: req.body.variation,
|
||||||
|
updatedby: req.body.updatedby,
|
||||||
|
} , { where: { id: Id } })
|
||||||
|
.then(data => {
|
||||||
|
res.send({'status':200,'message':"success",'data':data});
|
||||||
|
})
|
||||||
|
.catch(err => {
|
||||||
|
res.status(404).send({'status':404,
|
||||||
|
message: err.message || "Some error occurred while insertinging statements." ,'data': "No data"
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// create broken period
|
||||||
|
Brokenperiods.create({
|
||||||
|
entity_id: req.body.entity_id,
|
||||||
|
from: req.body.from,
|
||||||
|
to: req.body.to,
|
||||||
|
months: req.body.months,
|
||||||
|
cy: req.body.cy,
|
||||||
|
py: req.body.py,
|
||||||
|
variation: req.body.variation,
|
||||||
|
createdby: req.body.createdby,
|
||||||
|
})
|
||||||
|
.then(data => {
|
||||||
|
res.send({'status':200,'message':"success",'data':data});
|
||||||
|
})
|
||||||
|
.catch(err => {
|
||||||
|
res.status(404).send({'status':404,
|
||||||
|
message: err.message || "Some error occurred while insertinging statements." ,'data': "No data"
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -3,24 +3,22 @@
|
|||||||
//const Op = db.Sequelize.Op;
|
//const Op = db.Sequelize.Op;
|
||||||
|
|
||||||
const { sequelize, Statementsmaster ,Sectionsmaster , Subsectionsmaster,Itemsmaster } = require('../models')
|
const { sequelize, Statementsmaster ,Sectionsmaster , Subsectionsmaster,Itemsmaster } = require('../models')
|
||||||
|
const { logMsg } = require('../services/logger.js');
|
||||||
const { logMsg } = require('../services/logger');
|
|
||||||
|
|
||||||
|
|
||||||
//statementmaster
|
//statementmaster
|
||||||
|
|
||||||
// Retrieve all statementmaster from the database.
|
// Retrieve all statements from the database.
|
||||||
exports.StatmentList = (req, res) => {
|
exports.StatementsList = (req, res) => {
|
||||||
|
|
||||||
Statementsmaster.findAll({where : { is_active : 1 } })
|
Statementsmaster.findAll({where : { is_active : 1 } })
|
||||||
.then(data => {
|
.then(data => {
|
||||||
res.send({'status':200,'message':"success",'data':data});
|
res.send({'status':200,'message':"success",'data':data});
|
||||||
|
|
||||||
logMsg.info("Success :"(data));
|
logMsg.info("Success :"(data));
|
||||||
})
|
})
|
||||||
.catch(err => {
|
.catch(err => {
|
||||||
res.status(500).send({'status':404,
|
res.send({'status':404,
|
||||||
message: err.message || "Some error occurred while retrieving tutorials." ,'data': "No data" });
|
message: err.message || "Some error occurred while retrieving statements." ,'data': "No data" });
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -37,34 +35,15 @@ exports.Insertstatement = (req, res) => {
|
|||||||
// Save Tutorial in the database
|
// Save Tutorial in the database
|
||||||
Statementsmaster.create(statement)
|
Statementsmaster.create(statement)
|
||||||
.then(data => {
|
.then(data => {
|
||||||
res.send(data);
|
res.send({'status':200,'message':"success",'data':data});
|
||||||
|
logMsg.info("Success :"(data));
|
||||||
})
|
})
|
||||||
.catch(err => {
|
.catch(err => {
|
||||||
res.status(500).send({
|
res.status(500).send({'status':404,
|
||||||
message:
|
message: err.message || "Some error occurred while insertinging statements." ,'data': "No data"
|
||||||
err.message || "Some error occurred while creating the statement."
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
// Post a statement
|
|
||||||
// insert datas into statementmaster table.
|
|
||||||
// exports.Insertstatement = (req, res) => {
|
|
||||||
|
|
||||||
// Statementsmaster.create({
|
|
||||||
// statement: req.body.statement,
|
|
||||||
// is_active: req.body.is_active,
|
|
||||||
// createdby: req.body.createdby,
|
|
||||||
// updatedby: req.body.updatedby,
|
|
||||||
// })
|
|
||||||
// .then(data => {
|
|
||||||
// res.send({'status':200,'message':"success",'data':data});
|
|
||||||
// logMsg.info("Success :"(data));
|
|
||||||
// })
|
|
||||||
// .catch(err => {
|
|
||||||
// res.status(500).send({'status':404,
|
|
||||||
// message: err.message || "Some error occurred while retrieving tutorials." ,'data': "No data" });
|
|
||||||
// });
|
|
||||||
// };
|
|
||||||
|
|
||||||
// updates datas into statementmaster table.
|
// updates datas into statementmaster table.
|
||||||
exports.Updatestatement = (req, res) => {
|
exports.Updatestatement = (req, res) => {
|
||||||
@ -73,20 +52,13 @@ exports.Updatestatement = (req, res) => {
|
|||||||
Statementsmaster.update(req.body, {
|
Statementsmaster.update(req.body, {
|
||||||
where: { id: id }
|
where: { id: id }
|
||||||
})
|
})
|
||||||
.then(num => {
|
.then(data => {
|
||||||
if (num == 1) {
|
res.send({'status':200,'message':"success",'data':data});
|
||||||
res.send({
|
logMsg.info("Success :"(data));
|
||||||
message: "statement was updated successfully."
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
res.send({
|
|
||||||
message: `Cannot update statement with id=${id}. Maybe statement was not found or req.body is empty!`
|
|
||||||
});
|
|
||||||
}
|
|
||||||
})
|
})
|
||||||
.catch(err => {
|
.catch(err => {
|
||||||
res.status(500).send({
|
res.send({'status':404,
|
||||||
message: "Error updating statement with id=" + id
|
message: err.message || "Some error occurred while updating statements." ,'data': "No data"
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
@ -98,20 +70,13 @@ exports.Deletestatement = (req, res) => {
|
|||||||
Statementsmaster.update({ is_active : 0 },{
|
Statementsmaster.update({ is_active : 0 },{
|
||||||
where: { id: id }
|
where: { id: id }
|
||||||
})
|
})
|
||||||
.then(num => {
|
.then(data => {
|
||||||
if (num == 1) {
|
res.send({'status':200,'message':"success",'data':data});
|
||||||
res.send({
|
logMsg.info("Success :"(data));
|
||||||
message: "statement was deleted successfully!"
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
res.send({
|
|
||||||
message: `Cannot delete statement with id=${id}. Maybe statement was not found!`
|
|
||||||
});
|
|
||||||
}
|
|
||||||
})
|
})
|
||||||
.catch(err => {
|
.catch(err => {
|
||||||
res.status(500).send({
|
res.send({'status':404,
|
||||||
message: "Could not delete statement with id=" + id
|
message: err.message || "Some error occurred while updating statements." ,'data': "No data"
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
@ -128,7 +93,7 @@ exports.SectionList = (req, res) => {
|
|||||||
logMsg.info("Success :"(data));
|
logMsg.info("Success :"(data));
|
||||||
})
|
})
|
||||||
.catch(err => {
|
.catch(err => {
|
||||||
res.status(500).send({'status':404,
|
res.send({'status':404,
|
||||||
message: err.message || "Some error occurred while retrieving sections." ,'data': "No data" });
|
message: err.message || "Some error occurred while retrieving sections." ,'data': "No data" });
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
@ -146,12 +111,12 @@ exports.Insertsection = (req, res) => {
|
|||||||
// Save section in the database
|
// Save section in the database
|
||||||
Sectionsmaster.create(section)
|
Sectionsmaster.create(section)
|
||||||
.then(data => {
|
.then(data => {
|
||||||
res.send(data);
|
res.send({'status':200,'message':"success",'data':data});
|
||||||
|
logMsg.info("Success :"(data));
|
||||||
})
|
})
|
||||||
.catch(err => {
|
.catch(err => {
|
||||||
res.status(500).send({
|
res.send({'status':404,
|
||||||
message:
|
message: err.message || "Some error occurred while insertinging sectino." ,'data': "No data"
|
||||||
err.message || "Some error occurred while creating the section."
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
@ -162,20 +127,13 @@ exports.Updatesection = (req, res) => {
|
|||||||
Sectionsmaster.update(req.body, {
|
Sectionsmaster.update(req.body, {
|
||||||
where: { id: id }
|
where: { id: id }
|
||||||
})
|
})
|
||||||
.then(num => {
|
.then(data => {
|
||||||
if (num == 1) {
|
res.send({'status':200,'message':"success",'data':data});
|
||||||
res.send({
|
logMsg.info("Success :"(data));
|
||||||
message: "section was updated successfully."
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
res.send({
|
|
||||||
message: `Cannot update section with id=${id}. Maybe section was not found or req.body is empty!`
|
|
||||||
});
|
|
||||||
}
|
|
||||||
})
|
})
|
||||||
.catch(err => {
|
.catch(err => {
|
||||||
res.status(500).send({
|
res.send({'status':404,
|
||||||
message: "Error updating section with id=" + id
|
message: err.message || "Some error occurred while updating statements." ,'data': "No data"
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
@ -187,20 +145,15 @@ exports.Deletesection = (req, res) => {
|
|||||||
Sectionsmaster.update({ is_active : 0 },{
|
Sectionsmaster.update({ is_active : 0 },{
|
||||||
where: { id: id }
|
where: { id: id }
|
||||||
})
|
})
|
||||||
.then(num => {
|
|
||||||
if (num == 1) {
|
.then(data => {
|
||||||
res.send({
|
res.send({'status':200,'message':"success",'data':data});
|
||||||
message: "section was deleted successfully!"
|
logMsg.info("Success :"(data));
|
||||||
});
|
|
||||||
} else {
|
|
||||||
res.send({
|
|
||||||
message: `Cannot delete section with id=${id}. Maybe section was not found!`
|
|
||||||
});
|
|
||||||
}
|
|
||||||
})
|
})
|
||||||
|
|
||||||
.catch(err => {
|
.catch(err => {
|
||||||
res.status(500).send({
|
res.send({'status':404,
|
||||||
message: "Could not delete section with id=" + id
|
message: err.message || "Some error occurred while updating statements." ,'data': "No data"
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
@ -217,7 +170,7 @@ exports.SubsectionList = (req, res) => {
|
|||||||
logMsg.info("Success :"(data));
|
logMsg.info("Success :"(data));
|
||||||
})
|
})
|
||||||
.catch(err => {
|
.catch(err => {
|
||||||
res.status(500).send({'status':404,
|
res.send({'status':404,
|
||||||
message: err.message || "Some error occurred while retrieving subsections." ,'data': "No data" });
|
message: err.message || "Some error occurred while retrieving subsections." ,'data': "No data" });
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
@ -236,12 +189,12 @@ exports.Insertsubsection = (req, res) => {
|
|||||||
// Save Tutorial in the database
|
// Save Tutorial in the database
|
||||||
Subsectionsmaster.create(subsection)
|
Subsectionsmaster.create(subsection)
|
||||||
.then(data => {
|
.then(data => {
|
||||||
res.send(data);
|
res.send({'status':200,'message':"success",'data':data});
|
||||||
|
logMsg.info("Success :"(data));
|
||||||
})
|
})
|
||||||
.catch(err => {
|
.catch(err => {
|
||||||
res.status(500).send({
|
res.send({'status':404,
|
||||||
message:
|
message: err.message || "Some error occurred while insertinging subsection." ,'data': "No data"
|
||||||
err.message || "Some error occurred while creating the subsection."
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
@ -252,22 +205,16 @@ exports.Updatesubsection = (req, res) => {
|
|||||||
Subsectionsmaster.update(req.body, {
|
Subsectionsmaster.update(req.body, {
|
||||||
where: { id: id }
|
where: { id: id }
|
||||||
})
|
})
|
||||||
.then(num => {
|
.then(data => {
|
||||||
if (num == 1) {
|
res.send({'status':200,'message':"success",'data':data});
|
||||||
res.send({
|
logMsg.info("Success :"(data));
|
||||||
message: "subsection was updated successfully."
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
res.send({
|
|
||||||
message: `Cannot update subsection with id=${id}. Maybe subsection was not found or req.body is empty!`
|
|
||||||
});
|
|
||||||
}
|
|
||||||
})
|
})
|
||||||
.catch(err => {
|
.catch(err => {
|
||||||
res.status(500).send({
|
res.send({'status':404,
|
||||||
message: "Error updating subsection with id=" + id
|
message: err.message || "Some error occurred while updating statements." ,'data': "No data"
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
//delete
|
//delete
|
||||||
@ -277,20 +224,13 @@ exports.Deletesubsection = (req, res) => {
|
|||||||
Subsectionsmaster.update({ is_active : 0 },{
|
Subsectionsmaster.update({ is_active : 0 },{
|
||||||
where: { id: id }
|
where: { id: id }
|
||||||
})
|
})
|
||||||
.then(num => {
|
.then(data => {
|
||||||
if (num == 1) {
|
res.send({'status':200,'message':"success",'data':data});
|
||||||
res.send({
|
logMsg.info("Success :"(data));
|
||||||
message: "subsection was deleted successfully!"
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
res.send({
|
|
||||||
message: `Cannot delete subsection with id=${id}. Maybe subsection was not found!`
|
|
||||||
});
|
|
||||||
}
|
|
||||||
})
|
})
|
||||||
.catch(err => {
|
.catch(err => {
|
||||||
res.status(500).send({
|
res.send({'status':404,
|
||||||
message: "Could not delete subsection with id=" + id
|
message: err.message || "Some error occurred while updating statements." ,'data': "No data"
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
@ -306,7 +246,7 @@ exports.ItemList = (req, res) => {
|
|||||||
logMsg.info("Success :"(data));
|
logMsg.info("Success :"(data));
|
||||||
})
|
})
|
||||||
.catch(err => {
|
.catch(err => {
|
||||||
res.status(500).send({'status':404,
|
res.send({'status':404,
|
||||||
message: err.message || "Some error occurred while retrieving items." ,'data': "No data" });
|
message: err.message || "Some error occurred while retrieving items." ,'data': "No data" });
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
@ -331,12 +271,12 @@ exports.Insertitem = (req, res) => {
|
|||||||
// Save Tutorial in the database
|
// Save Tutorial in the database
|
||||||
Itemsmaster.create(item)
|
Itemsmaster.create(item)
|
||||||
.then(data => {
|
.then(data => {
|
||||||
res.send(data);
|
res.send({'status':200,'message':"success",'data':data});
|
||||||
|
logMsg.info("Success :"(data));
|
||||||
})
|
})
|
||||||
.catch(err => {
|
.catch(err => {
|
||||||
res.status(500).send({
|
res.send({'status':404,
|
||||||
message:
|
message: err.message || "Some error occurred while insertinging items." ,'data': "No data"
|
||||||
err.message || "Some error occurred while creating the item."
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
@ -347,20 +287,13 @@ exports.Updateitem = (req, res) => {
|
|||||||
Itemsmaster.update(req.body, {
|
Itemsmaster.update(req.body, {
|
||||||
where: { id: id }
|
where: { id: id }
|
||||||
})
|
})
|
||||||
.then(num => {
|
.then(data => {
|
||||||
if (num == 1) {
|
res.send({'status':200,'message':"success",'data':data});
|
||||||
res.send({
|
logMsg.info("Success :"(data));
|
||||||
message: "item was updated successfully."
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
res.send({
|
|
||||||
message: `Cannot update item with id=${id}. Maybe item was not found or req.body is empty!`
|
|
||||||
});
|
|
||||||
}
|
|
||||||
})
|
})
|
||||||
.catch(err => {
|
.catch(err => {
|
||||||
res.status(500).send({
|
res.send({'status':404,
|
||||||
message: "Error updating item with id=" + id
|
message: err.message || "Some error occurred while updating statements." ,'data': "No data"
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
@ -372,79 +305,424 @@ exports.Deleteitem = (req, res) => {
|
|||||||
Itemsmaster.update({ is_active : 0 },{
|
Itemsmaster.update({ is_active : 0 },{
|
||||||
where: { id: id }
|
where: { id: id }
|
||||||
})
|
})
|
||||||
.then(num => {
|
|
||||||
if (num == 1) {
|
|
||||||
res.send({
|
|
||||||
message: "item was deleted successfully!"
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
res.send({
|
|
||||||
message: `Cannot delete item with id=${id}. Maybe statement was not found!`
|
|
||||||
});
|
|
||||||
}
|
|
||||||
})
|
|
||||||
.catch(err => {
|
|
||||||
res.status(500).send({
|
|
||||||
message: "Could not delete item with id=" + id
|
|
||||||
});
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
exports.test = (req, res) => {
|
|
||||||
sequelize.query("select * from statementsmaster")
|
|
||||||
.then(data => {
|
.then(data => {
|
||||||
res.send({'status':200,'message':"success",'data':data});
|
res.send({'status':200,'message':"success",'data':data});
|
||||||
logMsg.info("Success :"(data));
|
logMsg.info("Success :"(data));
|
||||||
})
|
})
|
||||||
.catch(err => {
|
.catch(err => {
|
||||||
res.status(500).send({
|
res.send({'status':404,
|
||||||
message:
|
message: err.message || "Some error occurred while updating statements." ,'data': "No data"
|
||||||
err.message || "Some error occurred while retrieving tutorials."
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
//const db = require("../models");
|
||||||
|
//const Entities = db.tutorials;
|
||||||
|
//const Op = db.Sequelize.Op;
|
||||||
|
|
||||||
|
const { sequelize, Statementsmaster ,Sectionsmaster , Subsectionsmaster,Itemsmaster } = require('../models')
|
||||||
|
const { logMsg } = require('../services/logger.js');
|
||||||
|
|
||||||
|
|
||||||
|
//statementmaster
|
||||||
|
|
||||||
|
// Retrieve all statements from the database.
|
||||||
|
exports.StatementsList = (req, res) => {
|
||||||
|
|
||||||
|
Statementsmaster.findAll({where : { is_active : 1 } })
|
||||||
|
.then(data => {
|
||||||
|
res.send({'status':200,'message':"success",'data':data});
|
||||||
|
logMsg.info("Success :"(data));
|
||||||
|
})
|
||||||
|
.catch(err => {
|
||||||
|
res.send({'status':404,
|
||||||
|
message: err.message || "Some error occurred while retrieving statements." ,'data': "No data" });
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
exports.Insertstatement = (req, res) => {
|
||||||
|
// Create a statement
|
||||||
|
const statement = {
|
||||||
|
statement: req.body.statement,
|
||||||
|
is_active: req.body.is_active,
|
||||||
|
createdby: req.body.createdby,
|
||||||
|
updatedby: req.body.updatedby,
|
||||||
|
};
|
||||||
|
|
||||||
|
// Save Tutorial in the database
|
||||||
|
Statementsmaster.create(statement)
|
||||||
|
.then(data => {
|
||||||
|
res.send({'status':200,'message':"success",'data':data});
|
||||||
|
logMsg.info("Success :"(data));
|
||||||
|
})
|
||||||
|
.catch(err => {
|
||||||
|
res.status(500).send({'status':404,
|
||||||
|
message: err.message || "Some error occurred while insertinging statements." ,'data': "No data"
|
||||||
|
});
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
// updates datas into statementmaster table.
|
||||||
|
exports.Updatestatement = (req, res) => {
|
||||||
|
const id = req.params.id;
|
||||||
|
|
||||||
|
Statementsmaster.update(req.body, {
|
||||||
|
where: { id: id }
|
||||||
|
})
|
||||||
|
.then(data => {
|
||||||
|
res.send({'status':200,'message':"success",'data':data});
|
||||||
|
logMsg.info("Success :"(data));
|
||||||
|
})
|
||||||
|
.catch(err => {
|
||||||
|
res.send({'status':404,
|
||||||
|
message: err.message || "Some error occurred while updating statements." ,'data': "No data"
|
||||||
|
});
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
//delete
|
||||||
|
exports.Deletestatement = (req, res) => {
|
||||||
|
const id = req.params.id;
|
||||||
|
|
||||||
|
Statementsmaster.update({ is_active : 0 },{
|
||||||
|
where: { id: id }
|
||||||
|
})
|
||||||
|
.then(data => {
|
||||||
|
res.send({'status':200,'message':"success",'data':data});
|
||||||
|
logMsg.info("Success :"(data));
|
||||||
|
})
|
||||||
|
.catch(err => {
|
||||||
|
res.send({'status':404,
|
||||||
|
message: err.message || "Some error occurred while updating statements." ,'data': "No data"
|
||||||
|
});
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
//Sectionsmaster
|
||||||
|
|
||||||
|
// Retrieve all Sectionsmaster from the database.
|
||||||
|
exports.SectionList = (req, res) => {
|
||||||
|
|
||||||
|
Sectionsmaster.findAll({where : { is_active : 1 } })
|
||||||
|
.then(data => {
|
||||||
|
res.send({'status':200,'message':"success",'data':data});
|
||||||
|
logMsg.info("Success :"(data));
|
||||||
|
})
|
||||||
|
.catch(err => {
|
||||||
|
res.send({'status':404,
|
||||||
|
message: err.message || "Some error occurred while retrieving sections." ,'data': "No data" });
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
exports.Insertsection = (req, res) => {
|
||||||
|
// Create a section
|
||||||
|
const section = {
|
||||||
|
statement: req.body.statement,
|
||||||
|
section: req.body.section,
|
||||||
|
is_active: req.body.is_active,
|
||||||
|
createdby: req.body.createdby,
|
||||||
|
updatedby: req.body.updatedby,
|
||||||
|
};
|
||||||
|
|
||||||
|
// Save section in the database
|
||||||
|
Sectionsmaster.create(section)
|
||||||
|
.then(data => {
|
||||||
|
res.send({'status':200,'message':"success",'data':data});
|
||||||
|
logMsg.info("Success :"(data));
|
||||||
|
})
|
||||||
|
.catch(err => {
|
||||||
|
res.send({'status':404,
|
||||||
|
message: err.message || "Some error occurred while insertinging sectino." ,'data': "No data"
|
||||||
|
});
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
exports.Updatesection = (req, res) => {
|
||||||
|
const id = req.params.id;
|
||||||
|
|
||||||
|
Sectionsmaster.update(req.body, {
|
||||||
|
where: { id: id }
|
||||||
|
})
|
||||||
|
.then(data => {
|
||||||
|
res.send({'status':200,'message':"success",'data':data});
|
||||||
|
logMsg.info("Success :"(data));
|
||||||
|
})
|
||||||
|
.catch(err => {
|
||||||
|
res.send({'status':404,
|
||||||
|
message: err.message || "Some error occurred while updating statements." ,'data': "No data"
|
||||||
|
});
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
//delete
|
||||||
|
exports.Deletesection = (req, res) => {
|
||||||
|
const id = req.params.id;
|
||||||
|
|
||||||
|
Sectionsmaster.update({ is_active : 0 },{
|
||||||
|
where: { id: id }
|
||||||
|
})
|
||||||
|
|
||||||
|
.then(data => {
|
||||||
|
res.send({'status':200,'message':"success",'data':data});
|
||||||
|
logMsg.info("Success :"(data));
|
||||||
|
})
|
||||||
|
|
||||||
|
.catch(err => {
|
||||||
|
res.send({'status':404,
|
||||||
|
message: err.message || "Some error occurred while updating statements." ,'data': "No data"
|
||||||
|
});
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
//Subsectionsmaster
|
||||||
|
// Retrieve all Subsectionsmaster from the database.
|
||||||
|
exports.SubsectionList = (req, res) => {
|
||||||
|
|
||||||
|
Subsectionsmaster.findAll({where : { is_active : 1 } })
|
||||||
|
.then(data => {
|
||||||
|
res.send({'status':200,'message':"success",'data':data});
|
||||||
|
logMsg.info("Success :"(data));
|
||||||
|
})
|
||||||
|
.catch(err => {
|
||||||
|
res.send({'status':404,
|
||||||
|
message: err.message || "Some error occurred while retrieving subsections." ,'data': "No data" });
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
exports.Insertsubsection = (req, res) => {
|
||||||
|
// Create a statement
|
||||||
|
const subsection = {
|
||||||
|
section: req.body.section,
|
||||||
|
subsection: req.body.subsection,
|
||||||
|
itemtext: req.body.itemtext,
|
||||||
|
is_active: req.body.is_active,
|
||||||
|
createdby: req.body.createdby,
|
||||||
|
updatedby: req.body.updatedby,
|
||||||
|
};
|
||||||
|
|
||||||
|
// Save Tutorial in the database
|
||||||
|
Subsectionsmaster.create(subsection)
|
||||||
|
.then(data => {
|
||||||
|
res.send({'status':200,'message':"success",'data':data});
|
||||||
|
logMsg.info("Success :"(data));
|
||||||
|
})
|
||||||
|
.catch(err => {
|
||||||
|
res.send({'status':404,
|
||||||
|
message: err.message || "Some error occurred while insertinging subsection." ,'data': "No data"
|
||||||
|
});
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
exports.Updatesubsection = (req, res) => {
|
||||||
|
const id = req.params.id;
|
||||||
|
|
||||||
|
Subsectionsmaster.update(req.body, {
|
||||||
|
where: { id: id }
|
||||||
|
})
|
||||||
|
.then(data => {
|
||||||
|
res.send({'status':200,'message':"success",'data':data});
|
||||||
|
logMsg.info("Success :"(data));
|
||||||
|
})
|
||||||
|
.catch(err => {
|
||||||
|
res.send({'status':404,
|
||||||
|
message: err.message || "Some error occurred while updating statements." ,'data': "No data"
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
//delete
|
||||||
|
exports.Deletesubsection = (req, res) => {
|
||||||
|
const id = req.params.id;
|
||||||
|
|
||||||
|
Subsectionsmaster.update({ is_active : 0 },{
|
||||||
|
where: { id: id }
|
||||||
|
})
|
||||||
|
.then(data => {
|
||||||
|
res.send({'status':200,'message':"success",'data':data});
|
||||||
|
logMsg.info("Success :"(data));
|
||||||
|
})
|
||||||
|
.catch(err => {
|
||||||
|
res.send({'status':404,
|
||||||
|
message: err.message || "Some error occurred while updating statements." ,'data': "No data"
|
||||||
|
});
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
//itemsmaster
|
||||||
|
// Retrieve all itemsmaster from the database.
|
||||||
|
exports.ItemList = (req, res) => {
|
||||||
|
|
||||||
|
Itemsmaster.findAll({where : { is_active : 1 } })
|
||||||
|
.then(data => {
|
||||||
|
res.send({'status':200,'message':"success",'data':data});
|
||||||
|
logMsg.info("Success :"(data));
|
||||||
|
})
|
||||||
|
.catch(err => {
|
||||||
|
res.send({'status':404,
|
||||||
|
message: err.message || "Some error occurred while retrieving items." ,'data': "No data" });
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
exports.Insertitem = (req, res) => {
|
||||||
|
// Create a item
|
||||||
|
const item = {
|
||||||
|
statement: req.body.statement,
|
||||||
|
section: req.body.section,
|
||||||
|
subsection: req.body.subsection,
|
||||||
|
itemtext: req.body.itemtext,
|
||||||
|
is_active: req.body.is_active,
|
||||||
|
pvt_ltd: req.body.pvt_ltd,
|
||||||
|
llp: req.body.llp,
|
||||||
|
others: req.body.others,
|
||||||
|
formula: req.body.formula,
|
||||||
|
is_calculated: req.body.is_calculated,
|
||||||
|
createdby: req.body.createdby,
|
||||||
|
updatedby: req.body.updatedby,
|
||||||
|
};
|
||||||
|
|
||||||
|
// Save Tutorial in the database
|
||||||
|
Itemsmaster.create(item)
|
||||||
|
.then(data => {
|
||||||
|
res.send({'status':200,'message':"success",'data':data});
|
||||||
|
logMsg.info("Success :"(data));
|
||||||
|
})
|
||||||
|
.catch(err => {
|
||||||
|
res.send({'status':404,
|
||||||
|
message: err.message || "Some error occurred while insertinging items." ,'data': "No data"
|
||||||
|
});
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
exports.Updateitem = (req, res) => {
|
||||||
|
const id = req.params.id;
|
||||||
|
|
||||||
|
Itemsmaster.update(req.body, {
|
||||||
|
where: { id: id }
|
||||||
|
})
|
||||||
|
.then(data => {
|
||||||
|
res.send({'status':200,'message':"success",'data':data});
|
||||||
|
logMsg.info("Success :"(data));
|
||||||
|
})
|
||||||
|
.catch(err => {
|
||||||
|
res.send({'status':404,
|
||||||
|
message: err.message || "Some error occurred while updating statements." ,'data': "No data"
|
||||||
|
});
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
//delete
|
||||||
|
exports.Deleteitem = (req, res) => {
|
||||||
|
const id = req.params.id;
|
||||||
|
|
||||||
|
Itemsmaster.update({ is_active : 0 },{
|
||||||
|
where: { id: id }
|
||||||
|
})
|
||||||
|
.then(data => {
|
||||||
|
res.send({'status':200,'message':"success",'data':data});
|
||||||
|
logMsg.info("Success :"(data));
|
||||||
|
})
|
||||||
|
.catch(err => {
|
||||||
|
res.send({'status':404,
|
||||||
|
message: err.message || "Some error occurred while updating statements." ,'data': "No data"
|
||||||
|
});
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -17,6 +17,8 @@ module.exports = (sequelize, DataTypes) => {
|
|||||||
Brokenperiods.init(
|
Brokenperiods.init(
|
||||||
{
|
{
|
||||||
entity_id: { type: DataTypes.INTEGER },
|
entity_id: { type: DataTypes.INTEGER },
|
||||||
|
from: { type: DataTypes.DATE },
|
||||||
|
to: { type: DataTypes.DATE },
|
||||||
months: { type: DataTypes.INTEGER },
|
months: { type: DataTypes.INTEGER },
|
||||||
cy: { type: DataTypes.INTEGER },
|
cy: { type: DataTypes.INTEGER },
|
||||||
py: { type: DataTypes.INTEGER },
|
py: { type: DataTypes.INTEGER },
|
||||||
@ -31,6 +33,7 @@ module.exports = (sequelize, DataTypes) => {
|
|||||||
modelName: 'Brokenperiods',
|
modelName: 'Brokenperiods',
|
||||||
createdAt: 'createdon',
|
createdAt: 'createdon',
|
||||||
updatedAt: 'updatedon',
|
updatedAt: 'updatedon',
|
||||||
|
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
return Brokenperiods
|
return Brokenperiods
|
||||||
|
|||||||
@ -4,6 +4,7 @@ module.exports = app => {
|
|||||||
const master = require("../controllers/master.controller.js");
|
const master = require("../controllers/master.controller.js");
|
||||||
var router = require("express").Router();
|
var router = require("express").Router();
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @openapi
|
* @openapi
|
||||||
* /api/EntitiesList:
|
* /api/EntitiesList:
|
||||||
@ -13,34 +14,192 @@ module.exports = app => {
|
|||||||
* 200:
|
* 200:
|
||||||
* description: Returns a mysterious string.
|
* description: Returns a mysterious string.
|
||||||
*/
|
*/
|
||||||
// Retrieve all Tutorials
|
// insert or update broken periods
|
||||||
router.get("/EntitiesList", financials.findAllEntities);
|
router.post("/BrokenPeriods", financials.BrokenPeriods);
|
||||||
// get statment master data
|
|
||||||
router.get("/StatmentList", financials.StatmentList);
|
// get financials summary
|
||||||
// get statment master data
|
router.get("/FinantialsSummary/:id", financials.FinantialsSummary);
|
||||||
|
|
||||||
|
// get menu list
|
||||||
router.get("/MenuList/:losid", financials.MenuList);
|
router.get("/MenuList/:losid", financials.MenuList);
|
||||||
|
|
||||||
|
// Retrieve all Broken periods
|
||||||
|
router.get("/BrokenPeriodsList/:entityid", financials.BrokenPeriodsList);
|
||||||
|
|
||||||
|
|
||||||
//master.controller api's
|
//master.controller api's
|
||||||
// get statment master data
|
// get statment master data
|
||||||
router.get("/StatmentsList", master.StatmentList);
|
/**
|
||||||
|
* @openapi
|
||||||
|
* /api/StatementsList:
|
||||||
|
* get:
|
||||||
|
* description: This is List api statement!
|
||||||
|
* responses:
|
||||||
|
* 200:
|
||||||
|
* description: Returns a mysterious string.
|
||||||
|
*/
|
||||||
|
|
||||||
|
router.get("/StatementsList", master.StatementsList);
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @openapi
|
||||||
|
* /api/Insertstatement:
|
||||||
|
* get:
|
||||||
|
* description: This is Insert api statement!
|
||||||
|
* responses:
|
||||||
|
* 200:
|
||||||
|
* description: Returns a mysterious string.
|
||||||
|
*/
|
||||||
|
|
||||||
router.post("/Insertstatement", master.Insertstatement);
|
router.post("/Insertstatement", master.Insertstatement);
|
||||||
|
/**
|
||||||
|
* @openapi
|
||||||
|
* /api/Updatestatement/:id:
|
||||||
|
* get:
|
||||||
|
* description: This is update api statement!
|
||||||
|
* responses:
|
||||||
|
* 200:
|
||||||
|
* description: Returns a mysterious string.
|
||||||
|
*/
|
||||||
router.put("/Updatestatement/:id", master.Updatestatement);
|
router.put("/Updatestatement/:id", master.Updatestatement);
|
||||||
|
/**
|
||||||
|
* @openapi
|
||||||
|
* /api/Deletestatement/:id:
|
||||||
|
* get:
|
||||||
|
* description: This is Delete api statement!
|
||||||
|
* responses:
|
||||||
|
* 200:
|
||||||
|
* description: Returns a mysterious string.
|
||||||
|
*/
|
||||||
router.put("/Deletestatement/:id", master.Deletestatement);
|
router.put("/Deletestatement/:id", master.Deletestatement);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @openapi
|
||||||
|
* /api/SectionList:
|
||||||
|
* get:
|
||||||
|
* description: Welcome to swagger-jsdoc!
|
||||||
|
* responses:
|
||||||
|
* 200:
|
||||||
|
* description: Returns a mysterious string.
|
||||||
|
*/
|
||||||
|
|
||||||
router.get("/SectionList", master.SectionList);
|
router.get("/SectionList", master.SectionList);
|
||||||
|
/**
|
||||||
|
* @openapi
|
||||||
|
* /api/Insertsection:
|
||||||
|
* get:
|
||||||
|
* description: Welcome to swagger-jsdoc!
|
||||||
|
* responses:
|
||||||
|
* 200:
|
||||||
|
* description: Returns a mysterious string.
|
||||||
|
*/
|
||||||
router.post("/Insertsection", master.Insertsection);
|
router.post("/Insertsection", master.Insertsection);
|
||||||
|
/**
|
||||||
|
* @openapi
|
||||||
|
* /api/Updatesection/:id:
|
||||||
|
* get:
|
||||||
|
* description: Welcome to swagger-jsdoc!
|
||||||
|
* responses:
|
||||||
|
* 200:
|
||||||
|
* description: Returns a mysterious string.
|
||||||
|
*/
|
||||||
router.put("/Updatesection/:id", master.Updatesection);
|
router.put("/Updatesection/:id", master.Updatesection);
|
||||||
|
/**
|
||||||
|
* @openapi
|
||||||
|
* /api/Deletesection/:id:
|
||||||
|
* get:
|
||||||
|
* description: Welcome to swagger-jsdoc!
|
||||||
|
* responses:
|
||||||
|
* 200:
|
||||||
|
* description: Returns a mysterious string.
|
||||||
|
*/
|
||||||
router.put("/Deletesection/:id", master.Deletesection);
|
router.put("/Deletesection/:id", master.Deletesection);
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @openapi
|
||||||
|
* /api/SubsectionList:
|
||||||
|
* get:
|
||||||
|
* description: Welcome to swagger-jsdoc!
|
||||||
|
* responses:
|
||||||
|
* 200:
|
||||||
|
* description: Returns a mysterious string.
|
||||||
|
*/
|
||||||
router.get("/SubsectionList", master.SubsectionList);
|
router.get("/SubsectionList", master.SubsectionList);
|
||||||
|
/**
|
||||||
|
* @openapi
|
||||||
|
* /api/Insertsubsection:
|
||||||
|
* get:
|
||||||
|
* description: Welcome to swagger-jsdoc!
|
||||||
|
* responses:
|
||||||
|
* 200:
|
||||||
|
* description: Returns a mysterious string.
|
||||||
|
*/
|
||||||
router.post("/Insertsubsection", master.Insertsubsection);
|
router.post("/Insertsubsection", master.Insertsubsection);
|
||||||
|
/**
|
||||||
|
* @openapi
|
||||||
|
* /api/Updatesubsection/:id:
|
||||||
|
* get:
|
||||||
|
* description: Welcome to swagger-jsdoc!
|
||||||
|
* responses:
|
||||||
|
* 200:
|
||||||
|
* description: Returns a mysterious string.
|
||||||
|
*/
|
||||||
router.put("/Updatesubsection/:id", master.Updatesubsection);
|
router.put("/Updatesubsection/:id", master.Updatesubsection);
|
||||||
|
/**
|
||||||
|
* @openapi
|
||||||
|
* /api/Deletesubsection/:id:
|
||||||
|
* get:
|
||||||
|
* description: Welcome to swagger-jsdoc!
|
||||||
|
* responses:
|
||||||
|
* 200:
|
||||||
|
* description: Returns a mysterious string.
|
||||||
|
*/
|
||||||
router.put("/Deletesubsection/:id", master.Deletesubsection);
|
router.put("/Deletesubsection/:id", master.Deletesubsection);
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @openapi
|
||||||
|
* /api/ItemList:
|
||||||
|
* get:
|
||||||
|
* description: Welcome to swagger-jsdoc!
|
||||||
|
* responses:
|
||||||
|
* 200:
|
||||||
|
* description: Returns a mysterious string.
|
||||||
|
*/
|
||||||
router.get("/ItemList", master.ItemList);
|
router.get("/ItemList", master.ItemList);
|
||||||
|
/**
|
||||||
|
* @openapi
|
||||||
|
* /api/Insertitem:
|
||||||
|
* get:
|
||||||
|
* description: Welcome to swagger-jsdoc!
|
||||||
|
* responses:
|
||||||
|
* 200:
|
||||||
|
* description: Returns a mysterious string.
|
||||||
|
*/
|
||||||
router.post("/Insertitem", master.Insertitem);
|
router.post("/Insertitem", master.Insertitem);
|
||||||
|
/**
|
||||||
|
* @openapi
|
||||||
|
* /api/Updateitem/:id:
|
||||||
|
* get:
|
||||||
|
* description: Welcome to swagger-jsdoc!
|
||||||
|
* responses:
|
||||||
|
* 200:
|
||||||
|
* description: Returns a mysterious string.
|
||||||
|
*/
|
||||||
router.put("/Updateitem/:id", master.Updateitem);
|
router.put("/Updateitem/:id", master.Updateitem);
|
||||||
|
/**
|
||||||
|
* @openapi
|
||||||
|
* /api/Deleteitem/:id:
|
||||||
|
* get:
|
||||||
|
* description: Welcome to swagger-jsdoc!
|
||||||
|
* responses:
|
||||||
|
* 200:
|
||||||
|
* description: Returns a mysterious string.
|
||||||
|
*/
|
||||||
router.put("/Deleteitem/:id", master.Deleteitem);
|
router.put("/Deleteitem/:id", master.Deleteitem);
|
||||||
|
|
||||||
//sample
|
//sample
|
||||||
@ -51,8 +210,7 @@ module.exports = app => {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
// query execution test
|
|
||||||
router.get("/test", financials.test);
|
|
||||||
|
|
||||||
// third party api call example
|
// third party api call example
|
||||||
router.get('/third_party_api', (req, res) => {
|
router.get('/third_party_api', (req, res) => {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user