refactor: Remove unused booking function and streamline consultation flow handling

This commit is contained in:
2026-05-23 15:42:04 +02:00
parent 2a96e8bbb4
commit c4520fd71e
2 changed files with 13 additions and 26 deletions
-4
View File
@@ -1,4 +0,0 @@
# Buchungsrelatet processing
def buchen(name: str, Straße: str, plz:str, ort:str, ansprech:str, email:str, notes:str, agreements_accepted:str):
print("Gebucht")
+13 -22
View File
@@ -1991,30 +1991,21 @@ def booking_payment():
client = None
try:
if booking_flow == "payment":
buchen(
name=selected_package,
Straße=form_data["billing_street"],
plz=form_data["billing_zip"],
ort=form_data["billing_city"],
ansprech=form_data["contact_person"],
email=form_data["contact_email"],
if booking_flow == "consultation":
client, col = _get_collection("chat_messages")
col.insert_one(
{
"username": session.get("username"),
"sender": session.get("display_name") or session.get("username"),
"sender_role": "user",
"message": message,
"created_at": _utc_now_iso(),
"booking_flow": booking_flow,
"booking_package": package_raw,
"booking_data": form_data,
}
)
client, col = _get_collection("chat_messages")
col.insert_one(
{
"username": session.get("username"),
"sender": session.get("display_name") or session.get("username"),
"sender_role": "user",
"message": message,
"created_at": _utc_now_iso(),
"booking_flow": booking_flow,
"booking_package": package_raw,
"booking_data": form_data,
}
)
if booking_flow == "payment":
booking_number = f"BOOK-{datetime.utcnow().strftime('%Y%m%d%H%M%S')}"
invoice_amount = BOOKING_PRICE_MAP.get(package_raw, 0.0)