oncall-engine/engine/apps/schedules/tests
Vadim Stepanov 7a1f176cb5
Schedule score backend (#338)
This PR adds an endpoint returning a schedule quality score, overloaded
users and comments on the existing issues (e.g. balance issues or gaps).

## Limitations
- Since working hours editor is not implemented yet, there are only two
scores taken into account: balance score and a score representing the
ratio of time when someone is on-call to the whole time period.
- Time period is now set to be constant (90 days from today), so **in
some cases the results will be inaccurate** (when rotations don't align
with the time period)
- It only takes primary rotations into account (overrides are ignored)

## Usage
`GET /api/internal/v1/schedules/<pk>/quality?date=<TOMORROW_DATE>`

Note that `date` should be tomorrow date, because we can only be sure
about changing tomorrow's shifts (some of the shifts for current day
could be "deleted" but still show up in the UI).

## Example response
```json
{
  "total_score": 90,
  "comments": ["Schedule has no gaps", "Schedule is well-balanced, but still can be improved"],
  "overloaded_users": ["USSZ5WRH2CUA9", "U74XJZSSQGBIH"]
}
```

Issue: #118
2023-01-04 16:49:58 +00:00
..
calendars Schedule score backend (#338) 2023-01-04 16:49:58 +00:00
__init__.py World, meet OnCall! 2022-06-03 08:09:47 -06:00
conftest.py World, meet OnCall! 2022-06-03 08:09:47 -06:00
factories.py Initial web schedule model and serializers. Add override shift type. 2022-07-05 12:41:55 -03:00
test_amixr_users_in_ical.py World, meet OnCall! 2022-06-03 08:09:47 -06:00
test_custom_on_call_shift.py Handle no start date when calculating by day ical shift events 2023-01-02 11:53:49 -03:00
test_ical_proxy.py Add multiple ical all-day event for testing 2022-11-03 14:36:42 -03:00
test_ical_utils.py Do not include event repetitions terminated before start (until rrule) 2022-11-30 08:56:19 -03:00
test_on_call_schedule.py Update final schedule to consider priority level for overrides 2022-11-30 10:26:33 -03:00
test_quality_score.py Schedule score backend (#338) 2023-01-04 16:49:58 +00:00