Shelter PMS fully functional

This commit is contained in:
2024-12-09 16:36:11 +09:00
parent 60eaef5527
commit e76a80fb2f
47 changed files with 665 additions and 909 deletions

View File

@@ -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"
}