events are updated
This commit is contained in:
@@ -14,7 +14,7 @@ from api_validations.validations_request import (
|
||||
|
||||
from api_events.events.abstract_class import MethodToEvent, ActionsSchema
|
||||
from api_objects.auth.token_objects import EmployeeTokenObject, OccupantTokenObject
|
||||
from api_validations.core_response import return_json_response_from_alchemy
|
||||
from api_validations.core_response import AlchemyJsonResponse
|
||||
|
||||
|
||||
class CompanyListEventMethods(MethodToEvent):
|
||||
@@ -45,8 +45,10 @@ class CompanyListEventMethods(MethodToEvent):
|
||||
records = Companies.filter_active(
|
||||
*Companies.get_smart_query(list_options.query)
|
||||
)
|
||||
return return_json_response_from_alchemy(
|
||||
response=records, pagination=list_options
|
||||
return AlchemyJsonResponse(
|
||||
completed=True,
|
||||
message="Building Living Spaces are listed successfully",
|
||||
result=records,
|
||||
)
|
||||
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@ from databases import Departments
|
||||
|
||||
from api_events.events.abstract_class import MethodToEvent, ActionsSchema
|
||||
from api_objects.auth.token_objects import EmployeeTokenObject, OccupantTokenObject
|
||||
from api_validations.core_response import return_json_response_from_alchemy
|
||||
from api_validations.core_response import AlchemyJsonResponse
|
||||
|
||||
|
||||
class DepartmentListEventMethods(MethodToEvent):
|
||||
@@ -34,8 +34,10 @@ class DepartmentListEventMethods(MethodToEvent):
|
||||
*Departments.get_smart_query(smart_query=list_options.query),
|
||||
Departments.company_id == token_dict.selected_company.company_id,
|
||||
)
|
||||
return return_json_response_from_alchemy(
|
||||
response=records, pagination=list_options
|
||||
return AlchemyJsonResponse(
|
||||
completed=True,
|
||||
message="Departments are listed successfully",
|
||||
result=records,
|
||||
)
|
||||
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@ from databases import Duty
|
||||
|
||||
from api_events.events.abstract_class import MethodToEvent, ActionsSchema
|
||||
from api_objects.auth.token_objects import EmployeeTokenObject, OccupantTokenObject
|
||||
from api_validations.core_response import return_json_response_from_alchemy
|
||||
from api_validations.core_response import AlchemyJsonResponse
|
||||
|
||||
|
||||
class DutyListEventMethods(MethodToEvent):
|
||||
@@ -32,8 +32,10 @@ class DutyListEventMethods(MethodToEvent):
|
||||
records = Duty.filter_active(
|
||||
*Duty.get_smart_query(list_options.query),
|
||||
)
|
||||
return return_json_response_from_alchemy(
|
||||
response=records, pagination=list_options
|
||||
return AlchemyJsonResponse(
|
||||
completed=True,
|
||||
message="Duty list is brought successfully",
|
||||
result=records,
|
||||
)
|
||||
|
||||
|
||||
|
||||
@@ -15,7 +15,7 @@ from databases import Employees, Staff, People, EmployeeHistory
|
||||
|
||||
from api_events.events.abstract_class import MethodToEvent, ActionsSchema
|
||||
from api_objects.auth.token_objects import EmployeeTokenObject, OccupantTokenObject
|
||||
from api_validations.core_response import return_json_response_from_alchemy
|
||||
from api_validations.core_response import AlchemyJsonResponse
|
||||
|
||||
|
||||
class EmployeeListEventMethods(MethodToEvent):
|
||||
@@ -36,8 +36,10 @@ class EmployeeListEventMethods(MethodToEvent):
|
||||
*Employees.get_smart_query(smart_query=list_options.query),
|
||||
Employees.company_id == token_dict.selected_company.company_id,
|
||||
)
|
||||
return return_json_response_from_alchemy(
|
||||
response=records, pagination=list_options
|
||||
return AlchemyJsonResponse(
|
||||
completed=True,
|
||||
message="Employee are listed successfully",
|
||||
result=records,
|
||||
)
|
||||
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@ from databases import Staff, Duties
|
||||
|
||||
from api_events.events.abstract_class import MethodToEvent, ActionsSchema
|
||||
from api_objects.auth.token_objects import EmployeeTokenObject, OccupantTokenObject
|
||||
from api_validations.core_response import return_json_response_from_alchemy
|
||||
from api_validations.core_response import AlchemyJsonResponse
|
||||
|
||||
|
||||
class StaffListEventMethods(MethodToEvent):
|
||||
@@ -28,8 +28,10 @@ class StaffListEventMethods(MethodToEvent):
|
||||
records = Staff.filter_active(
|
||||
*Staff.get_smart_query(smart_query=list_options.query),
|
||||
)
|
||||
return return_json_response_from_alchemy(
|
||||
response=records, pagination=list_options
|
||||
return AlchemyJsonResponse(
|
||||
completed=True,
|
||||
message="Staff are listed successfully",
|
||||
result=records,
|
||||
)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user