GWM : calculation api validation
This commit is contained in:
parent
010e59811b
commit
69b90eabd3
@ -128,6 +128,20 @@ exports.calculate_month = async (req, res) => {
|
||||
});
|
||||
}
|
||||
|
||||
// check if the year and quarter window created or not and start the calculation
|
||||
const window = await QuarterlyWindowsConfiguration.findOne({
|
||||
where: {
|
||||
year: year,
|
||||
quarter: quarter
|
||||
}
|
||||
});
|
||||
if (!window) {
|
||||
return res.status(400).json({
|
||||
success: false,
|
||||
message: 'Year and quarter window not created'
|
||||
});
|
||||
}
|
||||
|
||||
const service = new IPICalculationService(dbConfig);
|
||||
const result = await service.runCompleteCalculation(year, quarter);
|
||||
await service.close();
|
||||
|
||||
Loading…
Reference in New Issue
Block a user