people endpoints and super user events built

This commit is contained in:
2025-04-13 17:28:20 +03:00
parent c3b7556e7e
commit 9a4696af77
363 changed files with 3270 additions and 264289 deletions

View File

@@ -1,5 +1,6 @@
from Schemas import (
Users,
Events,
Services,
Service2Events,
Applications,
@@ -10,15 +11,13 @@ from Schemas import (
)
list_of_event_codes = []
def init_service_to_event_matches_for_super_user(super_user, db_session=None) -> None:
service_match = Services.filter_one(
Services.service_name == "Super User",
db=db_session,
).data
for list_of_event_code in list_of_event_codes:
list_of_all_events = Events.filter_all(db=db_session).data
for list_of_event_code in list_of_all_events:
created_service = Service2Events.find_or_create(
service_id=service_match.id,
service_uu_id=str(service_match.uu_id),
@@ -33,16 +32,17 @@ def init_service_to_event_matches_for_super_user(super_user, db_session=None) ->
print(
f"UUID: {created_service.uu_id} event is saved to {service_match.uu_id}"
)
employee_added_service = Event2Employee.find_or_create(
event_service_id=created_service.id,
event_service_uu_id=str(created_service.uu_id),
employee_id=super_user.id,
employee_uu_id=str(super_user.uu_id),
is_confirmed=True,
db=db_session,
employee_added_service = Event2Employee.find_or_create(
event_service_id=service_match.id,
event_service_uu_id=str(service_match.uu_id),
employee_id=super_user.id,
employee_uu_id=str(super_user.uu_id),
is_confirmed=True,
db=db_session,
)
if employee_added_service.meta_data.created:
employee_added_service.save(db=db_session)
print(
f"UUID: {employee_added_service.uu_id} event is saved to {super_user.uu_id}"
)
if employee_added_service.meta_data.created:
employee_added_service.save(db=db_session)
print(
f"UUID: {employee_added_service.uu_id} event is saved to {super_user.uu_id}"
)