services are checked

This commit is contained in:
2024-11-08 17:14:02 +03:00
parent a5b1e0b2f4
commit c5b771e5cb
82 changed files with 1720 additions and 869 deletions

View File

@@ -25,12 +25,14 @@ class DepartmentListEventMethods(MethodToEvent):
@classmethod
def department_list(
cls, list_options: ListOptions, token_dict: Union[EmployeeTokenObject, OccupantTokenObject]
cls,
list_options: ListOptions,
token_dict: Union[EmployeeTokenObject, OccupantTokenObject],
):
Departments.filter_attr = list_options
records = Departments.filter_active(
*Departments.get_smart_query(smart_query=list_options.query),
Departments.company_id == token_dict.selected_company.company_id
Departments.company_id == token_dict.selected_company.company_id,
)
return return_json_response_from_alchemy(
response=records, pagination=list_options
@@ -81,7 +83,7 @@ class DepartmentUpdateEventMethods(MethodToEvent):
def department_update(
cls, company_uu_id: str, data: DepartmentsPydantic, token_dict
):
find_one_company = Departments.filter_one(Departments.uu_id==company_uu_id)
find_one_company = Departments.filter_one(Departments.uu_id == company_uu_id)
access_authorized_company = Departments.select_action(
duty_id=getattr(token_dict, "duty_id", 5),
filter_expr=[Departments.id == token_dict.get("")],