This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Booking(models.Model): | |
def get_booking_status_from_provider(self): | |
# this just calls GET for the itinerary_link from finished booking | |
if self.provider == PROVIDER_RAPID: | |
from roomstorm.rapid.feeds import ItineraryFeed | |
feed = ItineraryFeed(self.provider_data['itinerary_id'], self.meta_data['itinerary_link'], 'session') | |
return feed.retrieve_booking_data() | |
else: | |
raise NotImplementedError |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"dataFormatVersion": "0.2.3", | |
"updatedAt": "2019-07-04T12:10:00.000Z", | |
"legalEntity": { | |
"name": "Roomstorm", | |
"address": { | |
"road": "Somewhere pretty", | |
"houseNumber": "123", | |
"city": "Horní Dolní", | |
"countryCode": "CS" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import time | |
from time import sleep | |
import uos | |
from machine import Pin, PWM, Timer | |
from neopixel import NeoPixel | |
# http://pyladies.cz/v1/s016-micropython/index.html | |
# sudo screen /dev/ttyUSB0 115200 | |
# http://docs.micropython.org/en/v1.8/esp8266/esp8266/tutorial/neopixel.html |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//request | |
{ | |
"start_date": "2015-12-01", | |
"end_date": "2015-12-02", | |
"room_guests": { | |
"adults": 2, | |
"children_ages": [ | |
// or null | |
2, | |
4 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Request POST body - common | |
{ | |
"seller_site": "http://localhost:8000/backend/v1/sites/28950", | |
"buyer_site": "http://localhost:8000/backend/v1/sites/1", // the SFO for example, we can't say on backend which site user wants | |
"start_date": "2015-12-01", | |
"end_date": "2015-12-02", | |
"room_guests": { | |
"room_data": { | |
"price": 250, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// POST request body | |
{ | |
"site": 'http://localhost:8000/backend/v1/sites/28950', | |
"start_date": '2015-12-01', | |
"end_date": '2015-12-02', | |
"room_guests": { | |
"adults": 2, | |
"children_ages": [ // or null | |
2, | |
4 |