Fixed missing offer comment causing validation error

This commit is contained in:
Jonas Linter
2025-09-30 14:24:45 +02:00
parent 642b6cb7a5
commit 7380fa4378

View File

@@ -745,17 +745,20 @@ def create_xml_from_db(list: list[Tuple[Reservation, Customer]]):
hotel_name=reservation.hotel_name,
)
# Comments
offer_comment = CommentData(
name=CommentName2.ADDITIONAL_INFO,
text="Angebot/Offerta",
list_items=[
CommentListItemData(
value=reservation.offer,
language=customer.language,
list_item="1",
)
],
)
offer_comment = None
if reservation.offer is not None:
offer_comment = CommentData(
name=CommentName2.ADDITIONAL_INFO,
text="Angebot/Offerta",
list_items=[
CommentListItemData(
value=reservation.offer,
language=customer.language,
list_item="1",
)
],
)
comment = None
if reservation.user_comment:
comment = CommentData(
@@ -776,6 +779,10 @@ def create_xml_from_db(list: list[Tuple[Reservation, Customer]]):
comments_xml = None
if comments:
for c in comments:
_LOGGER.info(f"Creating comment: name={c.name}, text={c.text}, list_items={len(c.list_items)}")
comments_data = CommentsData(comments=comments)
comments_xml = alpine_bits_factory.create(comments_data, OtaMessageType.RETRIEVE)