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,6 +745,9 @@ def create_xml_from_db(list: list[Tuple[Reservation, Customer]]):
hotel_name=reservation.hotel_name, hotel_name=reservation.hotel_name,
) )
# Comments # Comments
offer_comment = None
if reservation.offer is not None:
offer_comment = CommentData( offer_comment = CommentData(
name=CommentName2.ADDITIONAL_INFO, name=CommentName2.ADDITIONAL_INFO,
text="Angebot/Offerta", text="Angebot/Offerta",
@@ -776,6 +779,10 @@ def create_xml_from_db(list: list[Tuple[Reservation, Customer]]):
comments_xml = None comments_xml = None
if comments: 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_data = CommentsData(comments=comments)
comments_xml = alpine_bits_factory.create(comments_data, OtaMessageType.RETRIEVE) comments_xml = alpine_bits_factory.create(comments_data, OtaMessageType.RETRIEVE)