Swapped form id for submission id
This commit is contained in:
@@ -431,7 +431,7 @@ class CommentFactory:
|
||||
|
||||
@staticmethod
|
||||
def _create_comments(
|
||||
comments_class: type, comment_class: type, data: CommentsData
|
||||
comments_class: type[RetrieveComments] | type[NotifComments], comment_class: type[RetrieveComment] | type[NotifComment], data: CommentsData
|
||||
) -> Any:
|
||||
"""Internal method to create comments of the specified type."""
|
||||
|
||||
@@ -440,6 +440,8 @@ class CommentFactory:
|
||||
# Create list items
|
||||
list_items = []
|
||||
for item_data in comment_data.list_items:
|
||||
_LOGGER.info(f"Creating list item: value={item_data.value}, list_item={item_data.list_item}, language={item_data.language}")
|
||||
|
||||
list_item = comment_class.ListItem(
|
||||
value=item_data.value,
|
||||
list_item=item_data.list_item,
|
||||
@@ -760,9 +762,15 @@ def create_xml_from_db(list: list[Tuple[Reservation, Customer]]):
|
||||
)
|
||||
],
|
||||
)
|
||||
comments = [offer_comment, comment] if comment else [offer_comment]
|
||||
comments_data = CommentsData(comments=comments)
|
||||
comments_xml = alpine_bits_factory.create(comments_data, OtaMessageType.RETRIEVE)
|
||||
comments = [offer_comment, comment]
|
||||
|
||||
# filter out None comments
|
||||
comments = [c for c in comments if c is not None]
|
||||
|
||||
comments_xml = None
|
||||
if not comments:
|
||||
comments_data = CommentsData(comments=comments)
|
||||
comments_xml = alpine_bits_factory.create(comments_data, OtaMessageType.RETRIEVE)
|
||||
|
||||
res_global_info = (
|
||||
OtaResRetrieveRs.ReservationsList.HotelReservation.ResGlobalInfo(
|
||||
|
||||
@@ -315,7 +315,7 @@ async def process_wix_form_submission(request: Request, data: Dict[str, Any], db
|
||||
|
||||
db_reservation = DBReservation(
|
||||
customer_id=db_customer.id,
|
||||
form_id=data.get("formId"),
|
||||
form_id=data.get("submissionId"),
|
||||
start_date=date.fromisoformat(start_date) if start_date else None,
|
||||
end_date=date.fromisoformat(end_date) if end_date else None,
|
||||
num_adults=num_adults,
|
||||
|
||||
@@ -192,7 +192,7 @@ async def main():
|
||||
|
||||
db_reservation = DBReservation(
|
||||
customer_id=db_customer.id,
|
||||
form_id=data.get("formId"),
|
||||
form_id=data.get("submissionId"),
|
||||
start_date=date.fromisoformat(start_date) if start_date else None,
|
||||
end_date=date.fromisoformat(end_date) if end_date else None,
|
||||
num_adults=num_adults,
|
||||
|
||||
Reference in New Issue
Block a user