Shelter PMS fully functional
This commit is contained in:
@@ -2,6 +2,38 @@ from .base_plugin import BasePMSPlugin
|
||||
|
||||
|
||||
class EcviPMS(BasePMSPlugin):
|
||||
def fetch_and_parse(self):
|
||||
# Реализация логики для ECVI
|
||||
pass
|
||||
"""
|
||||
Плагин для PMS Shelter.
|
||||
"""
|
||||
def fetch_data(self):
|
||||
print("Fetching data from Ecvi PMS...")
|
||||
# Реализация метода получения данных из PMS Shelter
|
||||
response = requests.get(self.pms_config.url, headers={"Authorization": f"Bearer {self.pms_config.token}"})
|
||||
print("Response status:", response.status_code)
|
||||
response.raise_for_status()
|
||||
data = response.json()
|
||||
print("Number of rooms:", len(data))
|
||||
return data
|
||||
json_schema = {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"id": {"type": "integer"},
|
||||
"number": {"type": "integer"},
|
||||
"roomTypeName": {"type": "string"},
|
||||
"checkInStatus": {"type": "string"},
|
||||
"guests": {"type": "array"},
|
||||
},
|
||||
"required": ["id", "number", "roomTypeName", "checkInStatus", "guests"]
|
||||
}
|
||||
def get_default_parser_settings(self):
|
||||
"""
|
||||
Возвращает настройки парсера по умолчанию.
|
||||
"""
|
||||
return {
|
||||
"field_mapping": {
|
||||
"room_name": "roomNumber",
|
||||
"check_in": "from",
|
||||
"check_out": "until",
|
||||
},
|
||||
"date_format": "%Y-%m-%dT%H:%M:%S"
|
||||
}
|
||||
Reference in New Issue
Block a user