auth service up running
This commit is contained in:
@@ -2,7 +2,6 @@ import typing
|
||||
from typing import Union
|
||||
|
||||
from fastapi import status, HTTPException
|
||||
from fastapi.responses import JSONResponse
|
||||
|
||||
from databases import (
|
||||
Build,
|
||||
@@ -19,8 +18,7 @@ from api_validations.validations_request import (
|
||||
PatchRecord,
|
||||
ListOptions,
|
||||
)
|
||||
from api_validations.validations_response import ListBuildingResponse
|
||||
|
||||
from api_validations.validations_response import BuildResponse
|
||||
from ApiServices.api_handlers import AlchemyJsonResponse
|
||||
from api_events.events.abstract_class import MethodToEvent, ActionsSchema
|
||||
from api_objects.auth.token_objects import EmployeeTokenObject, OccupantTokenObject
|
||||
@@ -36,7 +34,7 @@ class BuildListEventMethods(MethodToEvent):
|
||||
"68b3b5ed-b74c-4a27-820f-3959214e94e9": "build_list",
|
||||
}
|
||||
__event_validation__ = {
|
||||
"68b3b5ed-b74c-4a27-820f-3959214e94e9": ListBuildingResponse,
|
||||
"68b3b5ed-b74c-4a27-820f-3959214e94e9": BuildResponse,
|
||||
}
|
||||
|
||||
@classmethod
|
||||
@@ -59,6 +57,9 @@ class BuildListEventMethods(MethodToEvent):
|
||||
completed=True,
|
||||
message="Building records listed successfully",
|
||||
result=records,
|
||||
cls_object=Build,
|
||||
filter_attributes=list_options,
|
||||
response_model=BuildResponse
|
||||
)
|
||||
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@ from api_validations.validations_request import (
|
||||
ListOptions,
|
||||
)
|
||||
|
||||
from api_validations.validations_response.building_responses import BuildAreaListResponse
|
||||
from api_validations.validations_response import BuildResponse, BuildAreaResponse
|
||||
|
||||
from ApiServices.api_handlers import AlchemyJsonResponse
|
||||
from api_events.events.abstract_class import MethodToEvent, ActionsSchema
|
||||
@@ -25,7 +25,7 @@ class BuildAreaListEventMethods(MethodToEvent):
|
||||
"0bb51845-65a2-4340-8872-a3b5aad95468": "build_area_list",
|
||||
}
|
||||
__event_validation__ = {
|
||||
"0bb51845-65a2-4340-8872-a3b5aad95468": BuildAreaListResponse,
|
||||
"0bb51845-65a2-4340-8872-a3b5aad95468": BuildAreaResponse,
|
||||
}
|
||||
|
||||
@classmethod
|
||||
@@ -56,7 +56,7 @@ class BuildAreaListEventMethods(MethodToEvent):
|
||||
result=records,
|
||||
cls_object=BuildArea,
|
||||
filter_attributes=list_options,
|
||||
response_model=BuildAreaListResponse
|
||||
response_model=BuildResponse
|
||||
)
|
||||
|
||||
|
||||
|
||||
@@ -1,23 +1,18 @@
|
||||
from typing import Union
|
||||
|
||||
from fastapi.responses import JSONResponse
|
||||
from fastapi import status
|
||||
|
||||
from api_validations.validations_response.parts import BuildPartsListResponse
|
||||
from databases import (
|
||||
Build,
|
||||
BuildParts,
|
||||
)
|
||||
from ApiServices.api_handlers import AlchemyJsonResponse
|
||||
from api_validations.validations_response import BuildPartsListResponse
|
||||
from api_events.events.abstract_class import MethodToEvent, ActionsSchema
|
||||
from api_objects.auth.token_objects import EmployeeTokenObject, OccupantTokenObject
|
||||
from ApiServices.api_handlers import AlchemyJsonResponse
|
||||
|
||||
from api_validations.validations_request import (
|
||||
InsertBuildParts,
|
||||
UpdateBuildParts,
|
||||
ListOptions,
|
||||
)
|
||||
|
||||
from databases import (
|
||||
Build,
|
||||
BuildParts,
|
||||
)
|
||||
|
||||
class BuildingBuildPartsListEventMethods(MethodToEvent):
|
||||
|
||||
@@ -48,6 +43,9 @@ class BuildingBuildPartsListEventMethods(MethodToEvent):
|
||||
completed=True,
|
||||
message="Building parts listed successfully",
|
||||
result=records,
|
||||
cls_object=BuildParts,
|
||||
filter_attributes=list_options,
|
||||
response_model=BuildPartsListResponse,
|
||||
)
|
||||
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@ from api_validations.validations_request import (
|
||||
ListOptions,
|
||||
)
|
||||
|
||||
from api_validations.validations_response.building_responses import BuildSitesListResponse
|
||||
from api_validations.validations_response import BuildSitesResponse
|
||||
|
||||
from ApiServices.api_handlers import AlchemyJsonResponse
|
||||
from api_events.events.abstract_class import MethodToEvent, ActionsSchema
|
||||
@@ -25,7 +25,7 @@ class BuildSitesListEventMethods(MethodToEvent):
|
||||
"6798414c-6c7d-47f0-9d8b-6935a0f51c2e": "build_sites_list",
|
||||
}
|
||||
__event_validation__ = {
|
||||
"6798414c-6c7d-47f0-9d8b-6935a0f51c2e": BuildSitesListResponse,
|
||||
"6798414c-6c7d-47f0-9d8b-6935a0f51c2e": BuildSitesResponse,
|
||||
}
|
||||
|
||||
@classmethod
|
||||
@@ -64,7 +64,7 @@ class BuildSitesListEventMethods(MethodToEvent):
|
||||
result=records,
|
||||
cls_object=BuildSites,
|
||||
filter_attributes=list_options,
|
||||
response_model=BuildSitesListResponse
|
||||
response_model=BuildSitesResponse
|
||||
)
|
||||
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@ from ApiServices.api_handlers import AlchemyJsonResponse
|
||||
from api_validations.validations_request import (
|
||||
ListOptions,
|
||||
)
|
||||
from api_validations.validations_response.building_responses import BuildTypesListResponse
|
||||
from api_validations.validations_response import BuildTypesResponse
|
||||
from databases.sql_models.building.build import BuildTypes
|
||||
|
||||
|
||||
@@ -17,7 +17,7 @@ class BuildTypesListEventMethods(MethodToEvent):
|
||||
"5344d03c-fc47-43ec-8c44-6c2acd7e5d9f": "build_types_list",
|
||||
}
|
||||
__event_validation__ = {
|
||||
"5344d03c-fc47-43ec-8c44-6c2acd7e5d9f": BuildTypesListResponse
|
||||
"5344d03c-fc47-43ec-8c44-6c2acd7e5d9f": BuildTypesResponse
|
||||
}
|
||||
|
||||
@classmethod
|
||||
@@ -43,13 +43,10 @@ class BuildTypesListEventMethods(MethodToEvent):
|
||||
return AlchemyJsonResponse(
|
||||
completed=False,
|
||||
message="You are not authorized to access this endpoint",
|
||||
result=None
|
||||
)
|
||||
else:
|
||||
return AlchemyJsonResponse(
|
||||
completed=False,
|
||||
message="You are not authorized to access this endpoint",
|
||||
result=None
|
||||
result=None,
|
||||
cls_object=BuildTypes,
|
||||
filter_attributes=list_options,
|
||||
response_model=BuildTypesResponse
|
||||
)
|
||||
|
||||
|
||||
|
||||
@@ -19,7 +19,7 @@ from api_validations.validations_request import (
|
||||
UpdateBuildLivingSpace,
|
||||
ListOptions,
|
||||
)
|
||||
from api_validations.validations_response.living_space import LivingSpaceListResponse
|
||||
from api_validations.validations_response import LivingSpaceListResponse
|
||||
from databases.sql_models.event.event import Services
|
||||
|
||||
|
||||
@@ -108,7 +108,10 @@ class BuildingLivingSpacesListEventMethods(MethodToEvent):
|
||||
return AlchemyJsonResponse(
|
||||
completed=True,
|
||||
message="Living spaces listed successfully",
|
||||
result=records
|
||||
result=records,
|
||||
cls_object=BuildLivingSpace,
|
||||
filter_attributes=list_options,
|
||||
response_model=LivingSpaceListResponse,
|
||||
)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user