base context for wrappers updated
This commit is contained in:
@@ -4,18 +4,16 @@ Account records endpoint configurations.
|
||||
"""
|
||||
|
||||
from ApiEvents.abstract_class import RouteFactoryConfig, EndpointFactoryConfig, endpoint_wrapper
|
||||
from ApiEvents.base_request_model import DictRequestModel
|
||||
|
||||
from ApiEvents.base_request_model import EndpointBaseRequestModel
|
||||
|
||||
from Services.PostgresDb.Models.alchemy_response import DictJsonResponse
|
||||
from fastapi import Request, Path, Body
|
||||
|
||||
from .models import ListOptionsRequestModel
|
||||
|
||||
|
||||
@endpoint_wrapper("/account/records/address/list")
|
||||
async def address_list(request: "Request", data: ListOptionsRequestModel):
|
||||
async def address_list(request: "Request", data: EndpointBaseRequestModel):
|
||||
"""Handle address list endpoint."""
|
||||
auth_dict = address_list.auth
|
||||
return {
|
||||
"data": data,
|
||||
"request": str(request.headers),
|
||||
@@ -25,7 +23,7 @@ async def address_list(request: "Request", data: ListOptionsRequestModel):
|
||||
|
||||
|
||||
@endpoint_wrapper("/account/records/address/create")
|
||||
async def address_create(request: "Request", data: DictRequestModel):
|
||||
async def address_create(request: "Request", data: EndpointBaseRequestModel):
|
||||
"""Handle address creation endpoint."""
|
||||
return {
|
||||
"data": data,
|
||||
@@ -36,16 +34,18 @@ async def address_create(request: "Request", data: DictRequestModel):
|
||||
|
||||
|
||||
@endpoint_wrapper("/account/records/address/search")
|
||||
async def address_search(request: "Request", data: DictRequestModel):
|
||||
async def address_search(request: "Request", data: EndpointBaseRequestModel):
|
||||
"""Handle address search endpoint."""
|
||||
return {"data": data}
|
||||
auth_dict = address_search.auth
|
||||
code_dict = getattr(address_search, 'func_code', {"function_code": None})
|
||||
return {"auth_dict": auth_dict, "code_dict": code_dict, "data": data}
|
||||
|
||||
|
||||
@endpoint_wrapper("/account/records/address/{address_uu_id}")
|
||||
async def address_update(
|
||||
request: Request,
|
||||
address_uu_id: str = Path(..., description="UUID of the address to update"),
|
||||
request_data: DictRequestModel = Body(..., description="Request body"),
|
||||
request_data: EndpointBaseRequestModel = Body(..., description="Request body"),
|
||||
):
|
||||
"""
|
||||
Handle address update endpoint.
|
||||
@@ -58,6 +58,7 @@ async def address_update(
|
||||
Returns:
|
||||
DictJsonResponse: Response containing updated address info
|
||||
"""
|
||||
auth_dict = address_update.auth
|
||||
return DictJsonResponse(
|
||||
data={
|
||||
"address_uu_id": address_uu_id,
|
||||
|
||||
Reference in New Issue
Block a user