add bookingquotaid relative

This commit is contained in:
i 2026-02-08 13:09:36 +01:00
parent 8ecdc32b36
commit 6da22801c8
3 changed files with 18 additions and 3 deletions

3
.gitignore vendored
View file

@ -4,4 +4,5 @@
__pycache__/
venv
log.txt
log.txt
test.py

View file

@ -6,6 +6,7 @@ from config.constants import (
CHECKOUT_FORM_API,
ANNY_BASE_URL,
SERVICE_ID,
BOOKING_QUOTA_GRANT_ID,
)
@ -72,8 +73,7 @@ class BookingClient:
"add_ons_by_service": {SERVICE_ID: [[]]},
"sub_bookings_by_service": {},
# INFO: changes every week: e.g. booking for a monday needs new id
# "booking_quota_grant_id":"24735199",
"booking_quota_grant_id": "24735202",
"booking_quota_grant_id": str(BOOKING_QUOTA_GRANT_ID),
"strategy": "multi-resource",
},
# data = '{"resource_id":["15994"],"service_id":{"601":1},"start_date":"2026-02-03T22:30:00+01:00","end_date":"2026-02-03T23:30:00+01:00","description":"","customer_note":"","add_ons_by_service":{"601":[[]]},"sub_bookings_by_service":{},"booking_quota_grant_id":"24735199","strategy":"multi-resource"}'

View file

@ -1,3 +1,4 @@
from datetime import datetime
AUTH_BASE_URL = "https://auth.anny.eu"
ANNY_BASE_URL = "https://anny.eu"
BOOKING_API_BASE = "https://b.anny.eu/api/v1"
@ -15,6 +16,19 @@ SERVICE_ID = "601"
# RESOURCE_ID = None
RESOURCE_IDS = [15883, 15502, 15880, 15505, 15892]
# tum only:
# last: "booking_quota_grant_id":"24735199",
# -> every THURSDAY IT HAS TO BE +3 cuz reservation is for monday (changes to +3 of last)
INITIAL_BOOKING_QUOTA_GRANT_ID = 24735199
initial_date = datetime(2026, 1, 28)
current_date = datetime.now()
days_passed = (current_date - initial_date).days
weeks_passed = days_passed // 7
BOOKING_QUOTA_GRANT_ID = INITIAL_BOOKING_QUOTA_GRANT_ID + 3*weeks_passed
print(BOOKING_QUOTA_GRANT_ID)
TIMEZONE = "Europe/Berlin"
# SSO_PROVIDER = "kit" # Available: kit (add more in auth/providers/)
SSO_PROVIDER = "tum" # Available: kit (add more in auth/providers/)