backend/passfinder/recomendations/api/serializers.py

36 lines
1.1 KiB
Python
Raw Normal View History

2023-05-21 13:37:21 +03:00
from rest_framework import serializers
2023-05-24 17:58:51 +03:00
from passfinder.events.api.serializers import EventSerializer, HotelSerializer
2023-05-21 13:37:21 +03:00
class TinderProceedSerializer(serializers.Serializer):
2023-05-26 01:15:02 +03:00
action = serializers.ChoiceField(["left", "right"], write_only=True)
2023-05-24 17:58:51 +03:00
event = EventSerializer(read_only=True)
class AddToPreferenceSerializer(serializers.Serializer):
oid = serializers.CharField(write_only=True)
class EventOnboardingRetrieve(serializers.Serializer):
events = serializers.ListField(child=EventSerializer(), read_only=True)
2023-05-26 01:15:02 +03:00
types = serializers.ListField(
child=serializers.ChoiceField(["park", "monument", "museum", "unseco"]),
write_only=True,
)
2023-05-24 17:58:51 +03:00
class HotelOnboardingRetrieve(serializers.Serializer):
2023-05-26 01:15:02 +03:00
stars = serializers.ListField(
child=serializers.ChoiceField([1, 2, 3, 4, 5]), write_only=True
)
2023-05-24 17:58:51 +03:00
hotels = serializers.ListField(child=HotelSerializer(), read_only=True)
class TinderGetEventFilterSerializer(serializers.Serializer):
2023-05-26 01:15:02 +03:00
type = serializers.ListField(
child=serializers.ChoiceField(
["attraction", "museum", "movie", "play", "concert"]
)
)
event = EventSerializer()