refactor: Remove unused booking function and streamline consultation flow handling
This commit is contained in:
@@ -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
@@ -1991,30 +1991,21 @@ def booking_payment():
|
|||||||
|
|
||||||
client = None
|
client = None
|
||||||
try:
|
try:
|
||||||
if booking_flow == "payment":
|
if booking_flow == "consultation":
|
||||||
buchen(
|
client, col = _get_collection("chat_messages")
|
||||||
name=selected_package,
|
col.insert_one(
|
||||||
Straße=form_data["billing_street"],
|
{
|
||||||
plz=form_data["billing_zip"],
|
"username": session.get("username"),
|
||||||
ort=form_data["billing_city"],
|
"sender": session.get("display_name") or session.get("username"),
|
||||||
ansprech=form_data["contact_person"],
|
"sender_role": "user",
|
||||||
email=form_data["contact_email"],
|
"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":
|
if booking_flow == "payment":
|
||||||
booking_number = f"BOOK-{datetime.utcnow().strftime('%Y%m%d%H%M%S')}"
|
booking_number = f"BOOK-{datetime.utcnow().strftime('%Y%m%d%H%M%S')}"
|
||||||
invoice_amount = BOOKING_PRICE_MAP.get(package_raw, 0.0)
|
invoice_amount = BOOKING_PRICE_MAP.get(package_raw, 0.0)
|
||||||
|
|||||||
Reference in New Issue
Block a user