Open swoga opened 1 week ago
Yeah, I guess we don't really need a status field for maintenance when it can be deduced from the timestamps themselves, right?
Or, are you thinking this would be an option?
At first I thought of an additional option so as not to change any existing behavior (currently probably not relevant as there is no release yet). I also tried to implement it this way with an additional dummy status “Timed” where the real status is determined from time, but the code gets messy.
A purely time-controlled status would be sufficient for my (and most?) purposes. Would also fit better with the name "Schedules". One could still adjust the start and end time if one wants to change the status manually (such as the premature completion of a maintenance).
So my vote would be for pure time control and removal of the manual status field.
This should be simple enough to change. We remove the status
field from the table and add an attribute to Schedule
model that determines the status by matching the scheduled_at
and completed_at
fields. I can't remember off the top of my head how we pull schedules from the database, whether we use the status or the timestamps, but that'd be easy to change anyway.
@swoga do you fancy giving this a go?
I will give it a try!
That's presuming that a scheduled_at
and completed_at
is enough data to be usable?
A practical extension for Planned Maintenances / Schedules would be the automatic time-controlled determination of the status.
This would be useful to announce maintenance carried out by third parties, where you only get information about the planned start and end.
I tried to hack this feature together, but I'm not versed enough with Laravel to implement this properly.