sqlalchemy updated
This commit is contained in:
@@ -81,9 +81,9 @@ ACCOUNT_RECORDS_CONFIG = RouteFactoryConfig(
|
||||
endpoints=[
|
||||
EndpointFactoryConfig(
|
||||
url_prefix=prefix,
|
||||
url_endpoint="/address/list",
|
||||
url_of_endpoint="/account/records/address/list",
|
||||
endpoint="/address/list",
|
||||
url_endpoint="/list",
|
||||
url_of_endpoint=f"{prefix}/list",
|
||||
endpoint="/list",
|
||||
method="POST",
|
||||
summary="List Active/Delete/Confirm Address",
|
||||
description="List Active/Delete/Confirm Address",
|
||||
@@ -93,9 +93,9 @@ ACCOUNT_RECORDS_CONFIG = RouteFactoryConfig(
|
||||
),
|
||||
EndpointFactoryConfig(
|
||||
url_prefix=prefix,
|
||||
url_endpoint="/address/create",
|
||||
url_of_endpoint="/account/records/address/create",
|
||||
endpoint="/address/create",
|
||||
url_endpoint="/create",
|
||||
url_of_endpoint=f"{prefix}/create",
|
||||
endpoint="/create",
|
||||
method="POST",
|
||||
summary="Create Address with given auth levels",
|
||||
description="Create Address with given auth levels",
|
||||
@@ -105,9 +105,9 @@ ACCOUNT_RECORDS_CONFIG = RouteFactoryConfig(
|
||||
),
|
||||
EndpointFactoryConfig(
|
||||
url_prefix=prefix,
|
||||
url_endpoint="/address/search",
|
||||
url_of_endpoint="/account/records/address/search",
|
||||
endpoint="/address/search",
|
||||
url_endpoint="/search",
|
||||
url_of_endpoint=f"{prefix}/search",
|
||||
endpoint="/search",
|
||||
method="POST",
|
||||
summary="Search Address with given auth levels",
|
||||
description="Search Address with given auth levels",
|
||||
@@ -117,9 +117,9 @@ ACCOUNT_RECORDS_CONFIG = RouteFactoryConfig(
|
||||
),
|
||||
EndpointFactoryConfig(
|
||||
url_prefix=prefix,
|
||||
url_endpoint="/address/{address_uu_id}",
|
||||
url_of_endpoint="/account/records/address/{address_uu_id}",
|
||||
endpoint="/address/{address_uu_id}",
|
||||
url_endpoint="/{address_uu_id}",
|
||||
url_of_endpoint="{prefix}/" + "{address_uu_id}",
|
||||
endpoint="/{address_uu_id}",
|
||||
method="PUT",
|
||||
summary="Update Address with given auth levels",
|
||||
description="Update Address with given auth levels",
|
||||
|
||||
112
ApiEvents/EventServiceApi/events/address/endpoints.py
Normal file
112
ApiEvents/EventServiceApi/events/address/endpoints.py
Normal file
@@ -0,0 +1,112 @@
|
||||
"""
|
||||
Account records endpoint configurations.
|
||||
|
||||
"""
|
||||
|
||||
from ApiEvents.abstract_class import (
|
||||
RouteFactoryConfig,
|
||||
EndpointFactoryConfig,
|
||||
endpoint_wrapper,
|
||||
)
|
||||
from ApiEvents.base_request_model import EndpointBaseRequestModel
|
||||
|
||||
from Services.PostgresDb.Models.alchemy_response import DictJsonResponse
|
||||
from fastapi import Request, Path, Body
|
||||
|
||||
|
||||
@endpoint_wrapper("/address/list")
|
||||
async def address_list(request: "Request", data: EndpointBaseRequestModel):
|
||||
"""Handle address list endpoint."""
|
||||
auth_dict = address_list.auth
|
||||
code_dict = getattr(address_list, "func_code", {"function_code": None})
|
||||
return {"auth_dict": auth_dict, "code_dict": code_dict, "data": data}
|
||||
|
||||
|
||||
@endpoint_wrapper("/address/create")
|
||||
async def address_create(request: "Request", data: EndpointBaseRequestModel):
|
||||
"""Handle address creation endpoint."""
|
||||
return {
|
||||
"data": data,
|
||||
"request": str(request.headers),
|
||||
"request_url": str(request.url),
|
||||
"request_base_url": str(request.base_url),
|
||||
}
|
||||
|
||||
|
||||
@endpoint_wrapper("/address/update/{address_uu_id}")
|
||||
async def address_update(
|
||||
request: Request,
|
||||
address_uu_id: str = Path(..., description="UUID of the address to update"),
|
||||
request_data: EndpointBaseRequestModel = Body(..., description="Request body"),
|
||||
):
|
||||
"""
|
||||
Handle address update endpoint.
|
||||
|
||||
Args:
|
||||
request: FastAPI request object
|
||||
address_uu_id: UUID of the address to update
|
||||
request_data: Request body containing updated address data
|
||||
|
||||
Returns:
|
||||
DictJsonResponse: Response containing updated address info
|
||||
"""
|
||||
auth_dict = address_update.auth
|
||||
return DictJsonResponse(
|
||||
data={
|
||||
"address_uu_id": address_uu_id,
|
||||
"data": request_data.root,
|
||||
"request": str(request.headers),
|
||||
"request_url": str(request.url),
|
||||
"request_base_url": str(request.base_url),
|
||||
}
|
||||
)
|
||||
|
||||
|
||||
prefix = "/address"
|
||||
|
||||
|
||||
# Address Router Configuration
|
||||
ADDRESS_CONFIG = RouteFactoryConfig(
|
||||
name="address",
|
||||
prefix=prefix,
|
||||
tags=["Address"],
|
||||
include_in_schema=True,
|
||||
endpoints=[
|
||||
EndpointFactoryConfig(
|
||||
url_prefix=prefix,
|
||||
url_endpoint="/list",
|
||||
url_of_endpoint=f"{prefix}/list",
|
||||
endpoint="/list",
|
||||
method="POST",
|
||||
summary="List Active/Delete/Confirm Address",
|
||||
description="List Active/Delete/Confirm Address",
|
||||
is_auth_required=True,
|
||||
is_event_required=True,
|
||||
endpoint_function=address_list,
|
||||
),
|
||||
EndpointFactoryConfig(
|
||||
url_prefix=prefix,
|
||||
url_endpoint="/create",
|
||||
url_of_endpoint=f"{prefix}/create",
|
||||
endpoint="/create",
|
||||
method="POST",
|
||||
summary="Create Address with given auth levels",
|
||||
description="Create Address with given auth levels",
|
||||
is_auth_required=False,
|
||||
is_event_required=False,
|
||||
endpoint_function=address_create,
|
||||
),
|
||||
EndpointFactoryConfig(
|
||||
url_prefix=prefix,
|
||||
url_endpoint="/{address_uu_id}",
|
||||
url_of_endpoint="{prefix}/" + "{address_uu_id}",
|
||||
endpoint="/{address_uu_id}",
|
||||
method="PUT",
|
||||
summary="Update Address with given auth levels",
|
||||
description="Update Address with given auth levels",
|
||||
is_auth_required=True,
|
||||
is_event_required=True,
|
||||
endpoint_function=address_update,
|
||||
),
|
||||
],
|
||||
).as_dict()
|
||||
0
ApiEvents/EventServiceApi/events/company/company.py
Normal file
0
ApiEvents/EventServiceApi/events/company/company.py
Normal file
0
ApiEvents/EventServiceApi/events/company/duties.py
Normal file
0
ApiEvents/EventServiceApi/events/company/duties.py
Normal file
0
ApiEvents/EventServiceApi/events/company/duty.py
Normal file
0
ApiEvents/EventServiceApi/events/company/duty.py
Normal file
0
ApiEvents/EventServiceApi/events/company/staff.py
Normal file
0
ApiEvents/EventServiceApi/events/company/staff.py
Normal file
0
ApiEvents/EventServiceApi/events/identity/people.py
Normal file
0
ApiEvents/EventServiceApi/events/identity/people.py
Normal file
0
ApiEvents/EventServiceApi/events/identity/users.py
Normal file
0
ApiEvents/EventServiceApi/events/identity/users.py
Normal file
Reference in New Issue
Block a user