GWM
This commit is contained in:
parent
5fd5650971
commit
9fe4789721
@ -1,5 +1,5 @@
|
|||||||
|
|
||||||
const { sequelize,MasterP , MasterC , OtherIncomeP , OtherIncomeC} = require('../models')
|
const { sequelize,MasterP , MasterC , OtherIncomeP , OtherIncomeC , Master} = require('../models')
|
||||||
const { logMsg } = require('../services/logger.js');
|
const { logMsg } = require('../services/logger.js');
|
||||||
|
|
||||||
exports.otherIncomeList = async (req, res) =>
|
exports.otherIncomeList = async (req, res) =>
|
||||||
@ -81,6 +81,22 @@ exports.updateOtherIncome = async (req, res) =>
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
exports.getMasterData = async (req, res) =>
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
data =await Master.findAll();
|
||||||
|
res.send({'status':200 , message:"Success." ,'data': data});
|
||||||
|
|
||||||
|
} catch(err) {
|
||||||
|
res.status(500).send({'status':404,
|
||||||
|
message: err.message || "Some error occurred while inserting statements." ,'data': "No data"
|
||||||
|
}); } //end of try catch
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
24
app/models/Master.js
Normal file
24
app/models/Master.js
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
'use strict'
|
||||||
|
const { Model } = require('sequelize')
|
||||||
|
module.exports = (sequelize, DataTypes) => {
|
||||||
|
class Master extends Model {
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
Master.init(
|
||||||
|
{
|
||||||
|
|
||||||
|
order_id: { type: DataTypes.INTEGER },
|
||||||
|
column_name: { type: DataTypes.STRING },
|
||||||
|
master_value: { type: DataTypes.STRING }
|
||||||
|
|
||||||
|
},
|
||||||
|
{
|
||||||
|
sequelize,
|
||||||
|
tableName: 'master',
|
||||||
|
modelName: 'Master',
|
||||||
|
}
|
||||||
|
)
|
||||||
|
|
||||||
|
return Master
|
||||||
|
}
|
||||||
@ -9,7 +9,7 @@ module.exports = (sequelize, DataTypes) => {
|
|||||||
{
|
{
|
||||||
master_id: { type: DataTypes.INTEGER },
|
master_id: { type: DataTypes.INTEGER },
|
||||||
column_name: { type: DataTypes.STRING },
|
column_name: { type: DataTypes.STRING },
|
||||||
value: { type: DataTypes.INTEGER },
|
value: { type: DataTypes.STRING },
|
||||||
is_active: { type: DataTypes.INTEGER }
|
is_active: { type: DataTypes.INTEGER }
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|||||||
@ -10,7 +10,7 @@ module.exports = (sequelize, DataTypes) => {
|
|||||||
|
|
||||||
other_income_id: { type: DataTypes.INTEGER },
|
other_income_id: { type: DataTypes.INTEGER },
|
||||||
column_name: { type: DataTypes.STRING },
|
column_name: { type: DataTypes.STRING },
|
||||||
value: { type: DataTypes.INTEGER },
|
value: { type: DataTypes.STRING },
|
||||||
is_active: { type: DataTypes.INTEGER },
|
is_active: { type: DataTypes.INTEGER },
|
||||||
createdby: { type: DataTypes.INTEGER },
|
createdby: { type: DataTypes.INTEGER },
|
||||||
updatedby: { type: DataTypes.INTEGER }
|
updatedby: { type: DataTypes.INTEGER }
|
||||||
|
|||||||
@ -5,6 +5,19 @@ module.exports = app => {
|
|||||||
const { logMsg } = require('../services/logger.js');
|
const { logMsg } = require('../services/logger.js');
|
||||||
var router = require("express").Router();
|
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
|
* @swagger
|
||||||
* /api/otherIncomeList:
|
* /api/otherIncomeList:
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user