Example #1
0
def create_notification(user_id, content):
    data = {
        "user_id": user_id,
        "content": content,
        "sent_on": datetime.now().isoformat()
    }
    url = f"{NOTIFICATIONS_SERVICE}/notifications"
    return _post(url, data)
Example #2
0
def new_booking(user_id, rest_id, number_of_people, booking_datetime):
    booking = {
        "user_id":user_id,
        "restaurant_id":rest_id,
        "number_of_people":number_of_people,
        "booking_datetime":booking_datetime,
    }

    return _post(BOOKINGS_SERVICE+"bookings",booking)
Example #3
0
def create_user(dict_user):
    url = USER_SERVICE + '/users'
    return _post(url=url, json=dict_user)
Example #4
0
def create_notification(data):
    url = f"{NOTIFICATIONS_SERVICE}/notifications"
    return _post(url, data)
Example #5
0
def post_restaurant_table(restaurant_id, json):
    url = RESTAURANTS_SERVICE + ('/restaurants/%d/tables' % restaurant_id)
    return _post(url, json=json)
Example #6
0
def post_restaurant_rating(restaurant_id, json):
    url = RESTAURANTS_SERVICE + ('/restaurants/%d/rate' % restaurant_id)
    return _post(url, json=json)
Example #7
0
def post_restaurants(json):
    url = RESTAURANTS_SERVICE + '/restaurants'
    return _post(url, json=json)