updated events initializer

This commit is contained in:
2025-04-04 12:03:00 +03:00
parent f284d4c61b
commit b1c8203a33
24 changed files with 874 additions and 114 deletions

View File

@@ -86,6 +86,7 @@ from Schemas.identity.identity import (
OccupantTypes,
People,
Users,
Credentials,
RelationshipDutyPeople,
Contracts,
)
@@ -188,6 +189,7 @@ __all__ = [
"OccupantTypes",
"People",
"Users",
"Credentials",
"RelationshipDutyPeople",
"RelationshipEmployee2PostCode",
"Contracts",

View File

@@ -230,8 +230,7 @@ class Event2Employee(CrudCollection):
)
@classmethod
def get_event_codes(cls, employee_id: int) -> list:
db = cls.new_session()
def get_event_codes(cls, employee_id: int, db) -> list:
employee_events = cls.filter_all(
cls.employee_id == employee_id,
db=db,
@@ -328,8 +327,7 @@ class Event2Occupant(CrudCollection):
)
@classmethod
def get_event_codes(cls, build_living_space_id) -> list:
db = cls.new_session()
def get_event_codes(cls, build_living_space_id, db) -> list:
occupant_events = cls.filter_all(
cls.build_living_space_id == build_living_space_id,
db=db,

View File

@@ -18,6 +18,9 @@ class EndpointRestriction(CrudCollection):
__tablename__ = "endpoint_restriction"
__exclude__fields__ = []
operation_uu_id: Mapped[UUID] = mapped_column(
String, comment="UUID of the operation",
)
endpoint_function: Mapped[str] = mapped_column(
String, server_default="", comment="Function name of the API endpoint"
)