Adedd formid as unique id for reservations
This commit is contained in:
@@ -46,6 +46,10 @@ def main():
|
||||
os.makedirs(db_dir, exist_ok=True)
|
||||
# The DB file will be created by SQLAlchemy if it doesn't exist, but ensure directory exists
|
||||
|
||||
# for now we delete the existing DB for clean testing
|
||||
if os.path.exists(db_path):
|
||||
os.remove(db_path)
|
||||
print(f"Deleted existing SQLite DB at {db_path} for clean testing.")
|
||||
# Init DB
|
||||
init_db(config)
|
||||
|
||||
@@ -144,6 +148,7 @@ def main():
|
||||
|
||||
db_reservation = DBReservation(
|
||||
customer_id=db_customer.id,
|
||||
form_id=data.get("formId"),
|
||||
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,
|
||||
@@ -159,9 +164,12 @@ def main():
|
||||
# Success - use None instead of object() for cleaner XML output
|
||||
success = None
|
||||
|
||||
# UniqueID
|
||||
# UniqueID, we are using the formid as a stable unique id
|
||||
form_id = data.get("formId")
|
||||
|
||||
# hardcoding the type to 14 is allowed because 15 is only for cancellations and we don't handle those
|
||||
unique_id = ab.OtaResRetrieveRs.ReservationsList.HotelReservation.UniqueId(
|
||||
type_value=ab.UniqueIdType2.VALUE_14, id="6b34fe24ac2ff811"
|
||||
type_value=ab.UniqueIdType2.VALUE_14, id=form_id
|
||||
)
|
||||
|
||||
time_span = ab.OtaResRetrieveRs.ReservationsList.HotelReservation.RoomStays.RoomStay.TimeSpan(
|
||||
|
||||
Reference in New Issue
Block a user