Save information about execution days

1

Good afternoon, everyone. I have an automation monitoring system that consumes a table that contains information about n registered automations, about 40 presently. I would however like to make a check on the days on which these automations will run. Example: Automation 1 runs only Monday through Friday, automation 2 runs also on Saturdays and Sundays, etc. To not make these rules directly in the code I was thinking of doing a weekday table and binding it as foreign key to the table in which the automations are. My question is: Is this the best way? How would you do the table? I was thinking of doing a table with id and boolean days of the week and then treating that in source.

    
asked by anonymous 15.09.2018 / 17:51

1 answer

1

Good morning, my friend,

In companies that I have worked as both developer and other functions, it is common practice to perform a work scale of the equipment, which in our case we will call the automation scale, where you define which days of the week application will run that application or else a set of scales in general. If your routine changes, you only change this scale for that particular device or you only change the overall scale and let the system calculate the days. In addition you can create a holiday registry if you use it as a resuscitation, so that it calculates non-automation these days as well.

Any questions are available!

    
15.09.2018 / 18:35