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)
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)
def create_user(dict_user): url = USER_SERVICE + '/users' return _post(url=url, json=dict_user)
def create_notification(data): url = f"{NOTIFICATIONS_SERVICE}/notifications" return _post(url, data)
def post_restaurant_table(restaurant_id, json): url = RESTAURANTS_SERVICE + ('/restaurants/%d/tables' % restaurant_id) return _post(url, json=json)
def post_restaurant_rating(restaurant_id, json): url = RESTAURANTS_SERVICE + ('/restaurants/%d/rate' % restaurant_id) return _post(url, json=json)
def post_restaurants(json): url = RESTAURANTS_SERVICE + '/restaurants' return _post(url, json=json)