more services added

This commit is contained in:
2025-05-16 14:55:50 +03:00
parent 4606f0721d
commit 5f7cb35ccc
95 changed files with 2600 additions and 717 deletions

View File

@@ -22,7 +22,7 @@ class Configs(BaseSettings):
EMAIL_HOST: str = ""
DATETIME_FORMAT: str = ""
FORGOT_LINK: str = ""
ALLOW_ORIGINS: list = ["http://localhost:3000", "http://localhost:3001"]
ALLOW_ORIGINS: list = ["http://localhost:3000", "http://localhost:3001", "http://localhost:3001/api", "http://localhost:3001/api/"]
VERSION: str = "0.1.001"
DESCRIPTION: str = ""

View File

@@ -35,10 +35,6 @@ class EventCluster:
from schemas import Events, EndpointRestriction
with Events.new_session() as db_session:
# if to_save_endpoint := EndpointRestriction.filter_one(
# EndpointRestriction.operation_uu_id == self.endpoint_uu_id,
# db=db_session,
# ).data:
Events.set_session(db_session)
EndpointRestriction.set_session(db_session)
@@ -55,27 +51,14 @@ class EventCluster:
is_confirmed=True,
)
print('set_events_to_database event_dict_to_save', event_dict_to_save)
# event_found = Events.filter_one(
# Events.function_code == event_dict_to_save["function_code"],
# db=db_session,
# ).data
# if event_found:
# event_found.update(**event_dict_to_save)
# event_found.save(db=db_session)
# else:
# event_to_save_database = Events.find_or_create(
# **event_dict_to_save,
# include_args=[
# Events.function_code,
# Events.function_class,
# Events.endpoint_code,
# Events.endpoint_uu_id,
# ]
# )
# if event_to_save_database.meta_data.created:
# print(f"UUID: {event_to_save_database.uu_id} event is saved to {to_save_endpoint.uu_id}")
# event_to_save_database.save(db=db_session)
check_event = Events.query.filter(Events.endpoint_uu_id == event_dict_to_save["endpoint_uu_id"]).first()
if check_event:
check_event.update(**event_dict_to_save)
check_event.save()
else:
event_created = Events.create(**event_dict_to_save)
print(f"UUID: {event_created.uu_id} event is saved to {to_save_endpoint.uu_id}")
event_created.save()
def match_event(self, event_key: str) -> "Event":
"""