You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
77 lines
3.1 KiB
Python
77 lines
3.1 KiB
Python
from rest_framework import status
|
|
from rest_framework.response import Response
|
|
from rest_framework.views import APIView
|
|
|
|
class ClosingsView(APIView):
|
|
def get(self, request, organizer, device_id):
|
|
return Response({
|
|
'count': 0,
|
|
'next': None,
|
|
'previous': None,
|
|
'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):
|
|
def get(self, request, organizer):
|
|
return Response({
|
|
"count": 1,
|
|
"next": None,
|
|
"previous": None,
|
|
"results": [
|
|
{
|
|
"active": True,
|
|
"id": 1,
|
|
"last_modified": "2022-02-25T08:26:38.489714+01:00",
|
|
"name": "User",
|
|
"pin": None,
|
|
"team": {
|
|
"all_devices": True,
|
|
"can_accept_gift_cards": True,
|
|
"can_access_settings": True,
|
|
"can_manage_cash_close_sessions": False,
|
|
"can_open_drawer": True,
|
|
"can_perform_refunds": True,
|
|
"can_reprint_tickets": True,
|
|
"can_switch_events": True,
|
|
"can_view_all_orders": True,
|
|
"can_view_past_transactions": True,
|
|
"devices": [],
|
|
"id": 1,
|
|
"last_modified": "2022-02-25T08:26:38.484243+01:00",
|
|
"name": "Administrators"
|
|
},
|
|
"userid": "0001"
|
|
}
|
|
]
|
|
})
|
|
|
|
class PosprintlogView(APIView):
|
|
def post(self, request, organizer, event, order):
|
|
return Response({})
|