Added booking swagger description
(cherry picked from commit 794dd73)
This commit is contained in:
parent
80dce51db2
commit
b6f0616e8e
|
|
@ -1,4 +1,5 @@
|
||||||
from django.shortcuts import get_object_or_404
|
from django.shortcuts import get_object_or_404
|
||||||
|
from drf_yasg.utils import swagger_auto_schema
|
||||||
from rest_framework import generics, permissions, status, serializers
|
from rest_framework import generics, permissions, status, serializers
|
||||||
from rest_framework.response import Response
|
from rest_framework.response import Response
|
||||||
|
|
||||||
|
|
@ -96,6 +97,13 @@ class CreatePendingBooking(generics.CreateAPIView):
|
||||||
permission_classes = (permissions.AllowAny,)
|
permission_classes = (permissions.AllowAny,)
|
||||||
serializer_class = PendingBookingSerializer
|
serializer_class = PendingBookingSerializer
|
||||||
|
|
||||||
|
@swagger_auto_schema(operation_description="Request body params\n\n"
|
||||||
|
"IN GUESTONLINE (type:G): {"
|
||||||
|
"'restaurant_id', 'booking_time', "
|
||||||
|
"'booking_date', 'booked_persons_number'}\n"
|
||||||
|
"IN LASTABLE (type:L): {'booking_time', "
|
||||||
|
"'booked_persons_number', 'offer_id' (Req), "
|
||||||
|
"'email', 'phone', 'first_name', 'last_name'}")
|
||||||
def post(self, request, *args, **kwargs):
|
def post(self, request, *args, **kwargs):
|
||||||
data = request.data.copy()
|
data = request.data.copy()
|
||||||
if data.get('type') == Booking.LASTABLE and data.get("offer_id") is None:
|
if data.get('type') == Booking.LASTABLE and data.get("offer_id") is None:
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user