oncall-engine/engine/apps/api
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
..
permissions Update SCHEDULES_WRITE fallback role to EDITOR 2022-12-09 12:56:35 -03:00
serializers centralize timezone validation + add serializer validation for on call shifts and schedules (#924) 2022-12-01 14:13:39 +01:00
tests Handle no start date when calculating by day ical shift events 2023-01-02 11:53:49 -03:00
throttlers World, meet OnCall! 2022-06-03 08:09:47 -06:00
views 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
response_renderers.py World, meet OnCall! 2022-06-03 08:09:47 -06:00
urls.py remove apns + fix django-push-notifications migrations (#984) 2022-12-13 13:00:59 +01:00