new api service and logic implemented
This commit is contained in:
0
Events/TemplateServiceApi/__init__.py
Normal file
0
Events/TemplateServiceApi/__init__.py
Normal file
52
Events/TemplateServiceApi/endpoint/endpoints.py
Normal file
52
Events/TemplateServiceApi/endpoint/endpoints.py
Normal file
@@ -0,0 +1,52 @@
|
||||
from typing import TYPE_CHECKING, Dict, Any, Union
|
||||
|
||||
from ApiEvents.base_request_model import DictRequestModel, EndpointBaseRequestModel
|
||||
from ApiEvents.abstract_class import (
|
||||
RouteFactoryConfig,
|
||||
EndpointFactoryConfig,
|
||||
endpoint_wrapper,
|
||||
)
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from fastapi import Request, HTTPException, status, Body
|
||||
|
||||
from ApiValidations.Custom.token_objects import EmployeeTokenObject, OccupantTokenObject
|
||||
|
||||
|
||||
# Type aliases for common types
|
||||
|
||||
prefix = ""
|
||||
|
||||
|
||||
@endpoint_wrapper(f"{prefix}")
|
||||
async def authentication_select_company_or_occupant_type(
|
||||
request: "Request",
|
||||
data: EndpointBaseRequestModel,
|
||||
) -> Dict[str, Any]:
|
||||
"""
|
||||
Select company or occupant type.
|
||||
"""
|
||||
auth_dict = authentication_select_company_or_occupant_type.auth
|
||||
return {}
|
||||
|
||||
|
||||
_CONFIG = RouteFactoryConfig(
|
||||
name="",
|
||||
prefix=prefix,
|
||||
tags=[""],
|
||||
include_in_schema=True,
|
||||
endpoints=[
|
||||
EndpointFactoryConfig(
|
||||
url_prefix=prefix,
|
||||
url_endpoint="/",
|
||||
url_of_endpoint="/",
|
||||
endpoint="/",
|
||||
method="POST",
|
||||
summary="",
|
||||
description="",
|
||||
is_auth_required=True, # Needs token_dict
|
||||
is_event_required=False,
|
||||
endpoint_function=lambda: "",
|
||||
),
|
||||
],
|
||||
).as_dict()
|
||||
19
Events/TemplateServiceApi/endpoint/eventFile.py
Normal file
19
Events/TemplateServiceApi/endpoint/eventFile.py
Normal file
@@ -0,0 +1,19 @@
|
||||
"""
|
||||
request models.
|
||||
"""
|
||||
|
||||
from typing import TYPE_CHECKING, Dict, Any, Literal, Optional, TypedDict, Union
|
||||
from pydantic import BaseModel, Field, model_validator, RootModel, ConfigDict
|
||||
from ApiEvents.base_request_model import BaseRequestModel, DictRequestModel
|
||||
from ApiValidations.Custom.token_objects import EmployeeTokenObject, OccupantTokenObject
|
||||
from ApiValidations.Request.base_validations import ListOptions
|
||||
from ErrorHandlers.Exceptions.api_exc import HTTPExceptionApi
|
||||
from Schemas.identity.identity import (
|
||||
AddressPostcode,
|
||||
Addresses,
|
||||
RelationshipEmployee2PostCode,
|
||||
)
|
||||
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from fastapi import Request
|
||||
0
Events/TemplateServiceApi/route_configs.py
Normal file
0
Events/TemplateServiceApi/route_configs.py
Normal file
Reference in New Issue
Block a user