Fixed SelectionCriteria Filtering. Date wasn't added to pydantic model
This commit is contained in:
@@ -505,6 +505,9 @@ class ReadAction(AlpineBitsAction):
|
||||
|
||||
start_date = None
|
||||
|
||||
"""When given, the server will send only inquiries generated after the Start timestamp, regardless
|
||||
whether the client has retrieved them before or not."""
|
||||
|
||||
if hotel_read_request.selection_criteria is not None:
|
||||
start_date = datetime.fromisoformat(
|
||||
hotel_read_request.selection_criteria.start
|
||||
@@ -518,7 +521,8 @@ class ReadAction(AlpineBitsAction):
|
||||
.filter(Reservation.hotel_code == hotelid)
|
||||
)
|
||||
if start_date:
|
||||
stmt = stmt.filter(Reservation.start_date >= start_date)
|
||||
_LOGGER.info("Filtering reservations from start date %s", start_date)
|
||||
stmt = stmt.filter(Reservation.created_at >= start_date)
|
||||
# remove reservations that have been acknowledged via client_id
|
||||
elif client_info.client_id:
|
||||
subquery = (
|
||||
|
||||
Reference in New Issue
Block a user