events are updated
This commit is contained in:
@@ -17,7 +17,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
|
||||
from api_library.date_time_actions.date_functions import DateTimeLocal
|
||||
|
||||
|
||||
@@ -55,8 +55,10 @@ class DecisionBookListEventMethods(MethodToEvent):
|
||||
BuildDecisionBook.build_id == token_dict.selected_occupant.build_id,
|
||||
*BuildDecisionBook.get_smart_query(list_options.query),
|
||||
)
|
||||
return return_json_response_from_alchemy(
|
||||
response=records, pagination=list_options
|
||||
return AlchemyJsonResponse(
|
||||
completed=True,
|
||||
message="DecisionBook are listed successfully",
|
||||
result=records,
|
||||
)
|
||||
|
||||
|
||||
|
||||
@@ -20,7 +20,7 @@ from databases 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
|
||||
from api_library.date_time_actions.date_functions import system_arrow, client_arrow
|
||||
|
||||
from api_validations.validations_request import (
|
||||
@@ -75,20 +75,25 @@ class DecisionBookDecisionBookItemsListEventMethods(MethodToEvent):
|
||||
status_code=status.HTTP_404_NOT_FOUND,
|
||||
detail=f"No company is match with given Employee UUID {token_dict.selected_company.employee_uu_id}",
|
||||
)
|
||||
|
||||
BuildDecisionBookItems.filter_attr = BuildDecisionBookItems.FilterModel(**data.dump())
|
||||
records = BuildDecisionBookItems.filter_active(
|
||||
BuildDecisionBookItems.build_decision_book_id == decision_book.id
|
||||
)
|
||||
return JSONResponse(
|
||||
status_code=status.HTTP_200_OK,
|
||||
content=dict(
|
||||
total_count=records.count,
|
||||
count=len(records.data),
|
||||
message=f"Decision Book Items has found from given Decision Book UUID {data.build_decision_book_uu_id}",
|
||||
completed=True,
|
||||
data=[record.get_dict() for record in records.data],
|
||||
),
|
||||
return AlchemyJsonResponse(
|
||||
completed=True,
|
||||
message="DecisionBook are listed successfully",
|
||||
result=records,
|
||||
)
|
||||
# return JSONResponse(
|
||||
# status_code=status.HTTP_200_OK,
|
||||
# content=dict(
|
||||
# total_count=records.count,
|
||||
# count=len(records.data),
|
||||
# message=f"Decision Book Items has found from given Decision Book UUID {data.build_decision_book_uu_id}",
|
||||
# completed=True,
|
||||
# data=[record.get_dict() for record in records.data],
|
||||
# ),
|
||||
# )
|
||||
else:
|
||||
# BuildDecisionBookItems.pre_query = BuildDecisionBookItems.select_action(
|
||||
# occupant_id=token_dict.occupant_list["occupant_id"]
|
||||
|
||||
@@ -25,7 +25,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 DecisionBookPersonListEventMethods(MethodToEvent):
|
||||
|
||||
@@ -22,7 +22,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
|
||||
from api_library.date_time_actions.date_functions import system_arrow
|
||||
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
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 ProjectDecisionBookProjectDecisionBookEvents(MethodToEvent): ...
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
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 ProjectDecisionBookProjectDecisionBookPersonEvents(MethodToEvent): ...
|
||||
|
||||
Reference in New Issue
Block a user