Ridiculously difficult workdays / hours / minutes sla calculation to find out

Well, I have been spinning for the past two days, trying to figure it out.

I am working on a system that handles "cases". Each case has a type, and each type has an associated SLA that can be specified in days, hours or minutes. In addition to this, there is an administrative function that allows the user to specify the start and end time of the working day and the days of the week. I must indicate that the working hours are the same for each working day. So, for example, working hours can be from 9:00 to 13:30 on Monday, Wednesday and Thursday. I'm not going to worry about holidays in this function yet ... It's quite complicated as it is!

Given the days and hours of operation and the SLA, how can I calculate the date and time when it violates the SLA.

I get the feeling that since the minimum SLA resolution is set in minutes, I need to convert everything to minutes first. Obviously, the day / time in which the case is created must also be taken into account. Besides these two nuggets of wisdom, I will be honest ... I flounder :-)

Absolutely any help would be greatly appreciated in this regard. It is probably worth mentioning that if there is a library there, I will be glad to use it and move on. C # is my preferred language, but any solution would be great

Thank you very much in advance.

+4
source share
1 answer

Personally, I would have a list of days a week and the number of working minutes every day. Scroll the list by subtracting the working minutes from the task until it becomes 0, adding the whole day to the variable "real time until completion" throughout the entire working day.

If the remaining task remains less than a working day, then add it to the time variable until completion.

This tells me how there can be minutes between starting a task and completing a task, which can be compared to an SLA type.

Not sure if this is the best way, but this is the beginning :) I hope it helps

+4
source

All Articles