Add daily-round-robin scheduler algorithm#259
Add daily-round-robin scheduler algorithm#259brownhash wants to merge 2 commits intolinkedin:masterfrom
Conversation
Adds daily-round-robin algorithm for oncall scheduler. This algorithm creates events for a roster in a daily round robin fashion.
| -- Initialize contact modes | ||
| -- ----------------------------------------------------- | ||
| INSERT INTO `contact_mode` (`name`) | ||
| VALUES ('email'), ('sms'), ('call'), ('slack'), ('teams_messenger'); |
There was a problem hiding this comment.
why is teams_messenger being deleted?
There was a problem hiding this comment.
Its removed as teams_messenger is not a basic mode of contact in oncall.
Else it can be added any time in the contact_mode table to make it accessible in the UI.
| @@ -0,0 +1,442 @@ | |||
| from datetime import datetime, timedelta | |||
There was a problem hiding this comment.
This should inherit from either the default or round-robin scheduler. Probably round-robin, as that's what you're trying to do here. Too much copy-paste here.
In addition, I don't think this does round-robin scheduling, since this is copied from the default scheduler (which schedules to maximize time from previous shifts).
| roster_id = cursor.fetchone() | ||
| if roster_id is None: | ||
| raise HTTPNotFound() | ||
|
|
There was a problem hiding this comment.
This logic can be handled by the scheduler. In particular, the round-robin scheduler uses the calendar to guess the previous user if one has been deleted, so we don't need to do any schedule management in a roster_user action.
| </script> | ||
|
|
||
| <script> | ||
| function scheduler_select(e) |
There was a problem hiding this comment.
JS functions should live in oncall.js
| <label class="label-col">Scheduling Algorithms:</label> | ||
| <br> | ||
| <select name="from" class="form-control schedule-algorithm" id="schedule-algorithm"> | ||
| <select onClick="scheduler_select(event)" name="from" class="form-control schedule-algorithm" id="schedule-algorithm"> |
Adds a new scheduler that creates schedules in round-robin fashion and produces day long events by assigning every event with a different user.