GWM : calculation api validation
This commit is contained in:
parent
69b90eabd3
commit
80566a63ef
@ -311,6 +311,20 @@ exports.survey_auto_submit_and_calculate = async (req, res) => {
|
|||||||
return res.status(400).json({ success: false, message: validation.message });
|
return res.status(400).json({ success: false, message: validation.message });
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 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 autoSubmitResult = await runSurveyAutoSubmit(year, quarter);
|
const autoSubmitResult = await runSurveyAutoSubmit(year, quarter);
|
||||||
const calculationResult = await runQuarterCalculation(year, quarter);
|
const calculationResult = await runQuarterCalculation(year, quarter);
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user