Created
December 4, 2025 13:15
-
-
Save Angelelz/563f47ade53989673a3bb2a620210d6b to your computer and use it in GitHub Desktop.
Sub priority
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| export const getSubPriorityStatus = ( | |
| line: Omit<DailyWorkOrderResult, "followUpType">, | |
| ) => { | |
| if (line.ivrStatus === "IN PROGRESS:ON SITE") { | |
| return "01. IVR ONSITE"; | |
| } | |
| if ( | |
| line.Status_of_Call !== "COMPLETE" && | |
| line.Type_of_Problem === "EMERGENCY" | |
| ) { | |
| return "02. EMERGENCY"; | |
| } | |
| if ( | |
| line.Status_of_Call !== "COMPLETE" && | |
| line.Appointment_Status === "COORDINATE" | |
| ) { | |
| return "03. COORDINATE"; | |
| } | |
| if ( | |
| line.Status_of_Call !== "COMPLETE" && | |
| line.CUSTNMBR.toUpperCase() === "LOWCOM" | |
| ) { | |
| return "04. Lowe's"; | |
| } | |
| if (line.ivrStatus === "IN PROGRESS:UNSATISFACTORY") { | |
| return "05. UNSATISFACTORY"; | |
| } | |
| if ( | |
| line.Task_Date.valueOf() < addDays(startOfToday(), 2).valueOf() && | |
| ["DISPATCHED", "PTECHDISP"].includes(line.Appointment_Status) && | |
| line.ivrStatus === "IN PROGRESS:DISPATCH CONFIRMED" | |
| ) { | |
| return "06. NO IVR USE"; | |
| } | |
| if ( | |
| line.ivrStatus?.startsWith("COMPLETED") && | |
| !line.ivrStatus.endsWith("CONFIRMED") && | |
| line.Status_of_Call === "OPEN" | |
| ) { | |
| return "07. Completed in SC"; | |
| } | |
| if (line.Appointment_Status === "QTEAPVD") { | |
| return "08. Quote Approved"; | |
| } | |
| if ( | |
| line.Status_of_Call !== "COMPLETE" && | |
| StatusMap[line.Appointment_Status] === "Daily" && | |
| line.MODIFDT.valueOf() < addDays(startOfToday(), -1).valueOf() | |
| ) { | |
| return "09.Modified-Date Lapsed"; | |
| } | |
| if ( | |
| line.Status_of_Call !== "COMPLETE" && | |
| StatusMap[line.Appointment_Status] === "Daily" | |
| ) { | |
| return "10. Standard Priority Daily"; | |
| } | |
| if ( | |
| line.Status_of_Call !== "COMPLETE" && | |
| StatusMap[line.Appointment_Status] === "Bi-Weekly" | |
| ) { | |
| return "11. Bi-weekly Follow-up"; | |
| } | |
| if ( | |
| line.Status_of_Call === "COMPLETE" && | |
| line.Type_of_Problem === "EMERGENCY" | |
| ) { | |
| return "12. Completed Emergency"; | |
| } | |
| if (line.CUSTNMBR.toUpperCase() === "LOWCOM") { | |
| return "13. Completed Lowe's"; | |
| } | |
| if (line.Status_of_Call === "COMPLETE") { | |
| return "14. Completed Call Follow-up"; | |
| } | |
| if ( | |
| line.Status_of_Call === "OPEN" && | |
| line.Appointment_Status === "COMPLETE" | |
| ) { | |
| return "15. Complete Appt/Open Call Status"; | |
| } | |
| if ( | |
| line.Appointment_Status === "DISPATCHED" && | |
| line.Task_Date <= addDays(startOfToday(), 2) | |
| ) { | |
| return "16. Dispatched in 2-day Buffer"; | |
| } | |
| if ( | |
| line.Appointment_Status === "DISPATCHED" && | |
| line.Task_Date > addDays(startOfToday(), 2) | |
| ) { | |
| return "17. Dispatched Future Date"; | |
| } | |
| if (line.Appointment_Status === "PQUOTEAPPR") { | |
| return "18. Awaiting Customer Approval"; | |
| } | |
| if ( | |
| line.Appointment_Status === "PARTS ORD" || | |
| line.Appointment_Status === "CUSTORDMAT" | |
| ) { | |
| return "19. Future Date for Parts Ord"; | |
| } | |
| return "10. Standard Priority Daily"; | |
| }; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment