test fix for receipts view

main
n0emis 3 years ago
parent c4fdb1a1de
commit 60bca7375e
Signed by: n0emis
GPG Key ID: 00FAF748B777CF10

@ -6,6 +6,7 @@ from .views import *
urlpatterns = [ urlpatterns = [
url(r'^api/v1/organizers/(?P<organizer>[^/]+)/posdevices/(?P<device_id>[^/.]+)/closings/', ClosingsView.as_view(), name='api.closings'), url(r'^api/v1/organizers/(?P<organizer>[^/]+)/posdevices/(?P<device_id>[^/.]+)/closings/', ClosingsView.as_view(), name='api.closings'),
url(r'^api/v1/organizers/(?P<organizer>[^/]+)/posdevices/(?P<device_id>[^/.]+)/receipts/', ReceiptsView.as_view(), name='api.receipts'),
url(r'^api/v1/organizers/(?P<organizer>[^/]+)/pos/cashiers/', CashierView.as_view(), name='api.cashiers'), url(r'^api/v1/organizers/(?P<organizer>[^/]+)/pos/cashiers/', CashierView.as_view(), name='api.cashiers'),
url(r'^api/v1/organizers/(?P<organizer>[^/]+)/events/(?P<event>[^/.]+)/orders/(?P<order>[^/.]+)/posprintlog/', PosprintlogView.as_view(), name='api.printlog'), url(r'^api/v1/organizers/(?P<organizer>[^/]+)/events/(?P<event>[^/.]+)/orders/(?P<order>[^/.]+)/posprintlog/', PosprintlogView.as_view(), name='api.printlog'),
] ]

@ -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({

Loading…
Cancel
Save