IO-2132 Updated approach to ATS summary.

This commit is contained in:
Patrick Fic
2023-01-06 09:56:23 -08:00
parent 08d334e93a
commit 9de076f060
5 changed files with 27 additions and 34 deletions

View File

@@ -172,21 +172,6 @@ export function* calculateScheduleLoad({ payload: end }) {
}
}
//Calculate weekly ATS summary.
const startOfWeek = moment(end).startOf("week");
const endOfWeek = moment(end).endOf("week");
load.atsSummary = {};
arrJobs
.filter((j) => moment(j.scheduled_in).isBetween(startOfWeek, endOfWeek))
.forEach((j) => {
if (!load.atsSummary[j.alt_transport]) {
load.atsSummary[j.alt_transport] = 1;
} else {
load.atsSummary[j.alt_transport] =
load.atsSummary[j.alt_transport] + 1;
}
});
yield put(setProblemJobs(problemJobs));
yield put(scheduleLoadSuccess(load));
} catch (error) {