GWM : calculation api validation

This commit is contained in:
Gowtham M 2026-06-22 12:48:13 +05:30
parent 010e59811b
commit 69b90eabd3

View File

@ -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();