API: Add "currently inside" to checkin statistics

This commit is contained in:
Raphael Michel
2020-10-19 12:42:46 +02:00
parent 7c212ba79d
commit fcd0c65567
3 changed files with 4 additions and 1 deletions

View File

@@ -188,6 +188,7 @@ Endpoints
{ {
"checkin_count": 17, "checkin_count": 17,
"position_count": 42, "position_count": 42,
"inside_count": 12,
"event": { "event": {
"name": "Demo Conference" "name": "Demo Conference"
}, },

View File

@@ -111,7 +111,8 @@ class CheckinListViewSet(viewsets.ModelViewSet):
'name': str(ev.name), 'name': str(ev.name),
}, },
'checkin_count': cqs.count(), 'checkin_count': cqs.count(),
'position_count': pqs.count() 'position_count': pqs.count(),
'inside_count': clist.inside_count,
} }
op_by_item = { op_by_item = {

View File

@@ -565,6 +565,7 @@ def test_status(token_client, organizer, event, clist_all, item, other_item, ord
assert resp.status_code == 200 assert resp.status_code == 200
assert resp.data['checkin_count'] == 1 assert resp.data['checkin_count'] == 1
assert resp.data['position_count'] == 2 assert resp.data['position_count'] == 2
assert resp.data['inside_count'] == 1
assert resp.data['items'] == [ assert resp.data['items'] == [
{ {
'name': str(item.name), 'name': str(item.name),