import { lanes } from "./cyclecountCheck.js"; export const getCycleCountCheck = async ( age: number = 1000, type: string = "" ) => { /** * Get the lane data based on the age and type */ let filteredLanes = lanes.filter((t: any) => t.DaysSinceLast >= age); if (type != "") { return { sucess: true, message: `${filteredLanes.length} lanes that are of type ${type} and have not been cycle counted in the last ${age} days.`, data: filteredLanes.filter( (t: any) => t.rowType === type.toUpperCase() ), }; } else { return { success: true, message: `${filteredLanes.length} lanes grabed that have not been cycle counted in the last ${age} days.`, data: filteredLanes, }; } };