forked from CGM_Public/pretix_original
Check-in API: Include position data
This commit is contained in:
@@ -565,7 +565,10 @@ Order position endpoints
|
|||||||
Content-Type: application/json
|
Content-Type: application/json
|
||||||
|
|
||||||
{
|
{
|
||||||
"status": "ok"
|
"status": "ok",
|
||||||
|
"position": {
|
||||||
|
…
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
**Example response with required questions**:
|
**Example response with required questions**:
|
||||||
@@ -576,7 +579,10 @@ Order position endpoints
|
|||||||
Content-Type: text/json
|
Content-Type: text/json
|
||||||
|
|
||||||
{
|
{
|
||||||
"status": "incomplete"
|
"status": "incomplete",
|
||||||
|
"position": {
|
||||||
|
…
|
||||||
|
},
|
||||||
"questions": [
|
"questions": [
|
||||||
{
|
{
|
||||||
"id": 1,
|
"id": 1,
|
||||||
@@ -621,6 +627,9 @@ Order position endpoints
|
|||||||
{
|
{
|
||||||
"status": "error",
|
"status": "error",
|
||||||
"reason": "unpaid",
|
"reason": "unpaid",
|
||||||
|
"position": {
|
||||||
|
…
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Possible error reasons:
|
Possible error reasons:
|
||||||
|
|||||||
@@ -251,6 +251,8 @@ class CheckinListPositionViewSet(viewsets.ReadOnlyModelViewSet):
|
|||||||
except RequiredQuestionsError as e:
|
except RequiredQuestionsError as e:
|
||||||
return Response({
|
return Response({
|
||||||
'status': 'incomplete',
|
'status': 'incomplete',
|
||||||
|
'require_attention': op.item.checkin_attention or op.order.checkin_attention,
|
||||||
|
'position': OrderPositionSerializer(op, context=self.get_serializer_context()).data,
|
||||||
'questions': [
|
'questions': [
|
||||||
QuestionSerializer(q).data for q in e.questions
|
QuestionSerializer(q).data for q in e.questions
|
||||||
]
|
]
|
||||||
@@ -259,10 +261,14 @@ class CheckinListPositionViewSet(viewsets.ReadOnlyModelViewSet):
|
|||||||
return Response({
|
return Response({
|
||||||
'status': 'error',
|
'status': 'error',
|
||||||
'reason': e.code,
|
'reason': e.code,
|
||||||
|
'require_attention': op.item.checkin_attention or op.order.checkin_attention,
|
||||||
|
'position': OrderPositionSerializer(op, context=self.get_serializer_context()).data
|
||||||
}, status=400)
|
}, status=400)
|
||||||
else:
|
else:
|
||||||
return Response({
|
return Response({
|
||||||
'status': 'ok',
|
'status': 'ok',
|
||||||
|
'require_attention': op.item.checkin_attention or op.order.checkin_attention,
|
||||||
|
'position': OrderPositionSerializer(op, context=self.get_serializer_context()).data
|
||||||
}, status=201)
|
}, status=201)
|
||||||
|
|
||||||
def get_object(self):
|
def get_object(self):
|
||||||
|
|||||||
Reference in New Issue
Block a user