|
|
@ -1,3 +1,4 @@
|
|
|
|
|
|
|
|
from rest_framework import status
|
|
|
|
from rest_framework.response import Response
|
|
|
|
from rest_framework.response import Response
|
|
|
|
from rest_framework.views import APIView
|
|
|
|
from rest_framework.views import APIView
|
|
|
|
|
|
|
|
|
|
|
@ -10,6 +11,32 @@ class ClosingsView(APIView):
|
|
|
|
'results': []
|
|
|
|
'results': []
|
|
|
|
})
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class ReceiptsView(APIView):
|
|
|
|
|
|
|
|
def post(self, request, organizer, device_id):
|
|
|
|
|
|
|
|
return Response({
|
|
|
|
|
|
|
|
"additional_text": request.data.get('additional_text'),
|
|
|
|
|
|
|
|
"canceled": request.data.get('canceled'),
|
|
|
|
|
|
|
|
"cashier": request.data.get('cashier'),
|
|
|
|
|
|
|
|
"closing_id": request.data.get('closing_id'),
|
|
|
|
|
|
|
|
"currency": request.data.get('currency'),
|
|
|
|
|
|
|
|
"datetime_closed": request.data.get('datetime_closed'),
|
|
|
|
|
|
|
|
"datetime_opened": request.data.get('datetime_opened'),
|
|
|
|
|
|
|
|
"datetime_uploaded": request.data.get('datetime_closed'),
|
|
|
|
|
|
|
|
"device": device_id,
|
|
|
|
|
|
|
|
"email_to": request.data.get('email_to'),
|
|
|
|
|
|
|
|
"event": request.data.get('event'),
|
|
|
|
|
|
|
|
"fiscalisation_data": request.data.get('fiscalisation_data', {}),
|
|
|
|
|
|
|
|
"fiscalisation_qr": request.data.get('fiscalisation_qr'),
|
|
|
|
|
|
|
|
"fiscalisation_text": request.data.get('fiscalisation_text'),
|
|
|
|
|
|
|
|
"lines": request.data.get('lines', []),
|
|
|
|
|
|
|
|
"order": request.data.get('order'),
|
|
|
|
|
|
|
|
"payment_data": request.data.get('payment_data', {}),
|
|
|
|
|
|
|
|
"payment_type": request.data.get('payment_type'),
|
|
|
|
|
|
|
|
"payments": request.data.get('payments', []),
|
|
|
|
|
|
|
|
"receipt_id": request.data.get('receipt_id'),
|
|
|
|
|
|
|
|
"training": request.data.get('training')
|
|
|
|
|
|
|
|
}, status=status.HTTP_201_CREATED)
|
|
|
|
|
|
|
|
|
|
|
|
class CashierView(APIView):
|
|
|
|
class CashierView(APIView):
|
|
|
|
def get(self, request, organizer):
|
|
|
|
def get(self, request, organizer):
|
|
|
|
return Response({
|
|
|
|
return Response({
|
|
|
|