RealtyCalendar plugin

This commit is contained in:
2024-12-24 15:43:43 +09:00
parent 77bf0b8381
commit d5622f41a2
58 changed files with 374 additions and 1714 deletions

View File

@@ -74,7 +74,7 @@ class EcviPMSPlugin(BasePMSPlugin):
except requests.exceptions.RequestException as e:
self.logger.error(f"Ошибка запроса: {e}")
return []
self.logger.debug(f"\n\n\n\n\ndata: {data}\n\n\n\n\n")
# Фильтрация данных
filtered_data = [
{
@@ -87,7 +87,6 @@ class EcviPMSPlugin(BasePMSPlugin):
} for item in data if isinstance(item, dict) and item.get('occupancy') in ['проживание', 'под выезд', 'под заезд']
]
self.logger.debug(f"filtered_data: {filtered_data}")
# Сохранение данных в базу данных
@@ -108,7 +107,6 @@ class EcviPMSPlugin(BasePMSPlugin):
# Проверяем, существует ли уже резервация с таким внешним ID
reservation_id = item.get('reservation_id')
self.logger.debug(f"-----\n\n\nITEM : {item}\n\n\n---")
if not reservation_id:
self.logger.error("Ошибка: 'reservation_id' отсутствует в данных.")
return
@@ -123,6 +121,7 @@ class EcviPMSPlugin(BasePMSPlugin):
await sync_to_async(Reservation.objects.update_or_create)(
reservation_id=reservation_id,
defaults={
''
'room_number': item.get('room_number'),
'room_type': item.get('room_type'),
'check_in': item.get('checkin'),