updated services api
This commit is contained in:
@@ -23,13 +23,14 @@ from Schemas import (
|
||||
Events,
|
||||
EndpointRestriction,
|
||||
)
|
||||
from Controllers.mongo.database import mongo_handler
|
||||
from Controllers.Mongo.database import mongo_handler
|
||||
from Validations.token.validations import TokenDictType, EmployeeTokenObject, OccupantTokenObject, CompanyToken, OccupantToken, UserType
|
||||
from Validations.defaults.validations import CommonHeaders
|
||||
from Extends.redis.redis_handlers import RedisHandlers
|
||||
from Extends.token.password_module import PasswordModule
|
||||
from validations.password.validations import PasswordHistoryViaUser
|
||||
|
||||
from Extensions.OnMemory.redis_handlers import RedisHandlers
|
||||
from Extensions.Token.password_module import PasswordModule
|
||||
|
||||
|
||||
class UserHandlers:
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
from api_initializer.event_clusters import EventCluster, RouterCluster
|
||||
from Initializer.event_clusters import EventCluster, RouterCluster
|
||||
from index import endpoints_index
|
||||
from .supers_events import (
|
||||
SuperAreaListEvent,
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
from typing import Any
|
||||
|
||||
from api_initializer.event_clusters import Event
|
||||
from api_validations.response import (
|
||||
from Initializer.event_clusters import Event
|
||||
from Validations.response import (
|
||||
PaginateOnly,
|
||||
Pagination,
|
||||
PaginationResult,
|
||||
@@ -9,13 +9,13 @@ from api_validations.response import (
|
||||
PostgresResponse,
|
||||
EndpointResponse
|
||||
)
|
||||
from schemas import (
|
||||
from Validations.defaults.validations import CommonHeaders
|
||||
from Schemas import (
|
||||
BuildArea,
|
||||
Build,
|
||||
BuildParts,
|
||||
AccountRecords,
|
||||
)
|
||||
from api_validations.defaults.validations import CommonHeaders
|
||||
|
||||
|
||||
# List all area Super User
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
from api_initializer.event_clusters import EventCluster, RouterCluster
|
||||
from Initializer.event_clusters import EventCluster, RouterCluster
|
||||
from index import endpoints_index
|
||||
from .supers_events import (
|
||||
SuperPartsListEvent,
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
from typing import Any
|
||||
|
||||
from api_initializer.event_clusters import Event
|
||||
from api_validations.response import (
|
||||
from Initializer.event_clusters import Event
|
||||
from Validations.response import (
|
||||
PaginateOnly,
|
||||
Pagination,
|
||||
PaginationResult,
|
||||
@@ -9,12 +9,12 @@ from api_validations.response import (
|
||||
PostgresResponse,
|
||||
EndpointResponse
|
||||
)
|
||||
from schemas import (
|
||||
from Validations.defaults.validations import CommonHeaders
|
||||
from Schemas import (
|
||||
Build,
|
||||
BuildParts,
|
||||
AccountRecords,
|
||||
)
|
||||
from api_validations.defaults.validations import CommonHeaders
|
||||
|
||||
|
||||
# List all endpoint Super Parts
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
from api_initializer.event_clusters import EventCluster, RouterCluster
|
||||
from Initializer.event_clusters import EventCluster, RouterCluster
|
||||
from index import endpoints_index
|
||||
from .supers_events import (
|
||||
SuperBuildListEvent,
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
from typing import Any
|
||||
|
||||
from api_initializer.event_clusters import Event
|
||||
from api_validations.response import (
|
||||
from Initializer.event_clusters import Event
|
||||
from Validations.response import (
|
||||
PaginateOnly,
|
||||
Pagination,
|
||||
PaginationResult,
|
||||
@@ -9,12 +9,12 @@ from api_validations.response import (
|
||||
PostgresResponse,
|
||||
EndpointResponse
|
||||
)
|
||||
from schemas import (
|
||||
from Validations.defaults.validations import CommonHeaders
|
||||
from Schemas import (
|
||||
Build,
|
||||
BuildParts,
|
||||
AccountRecords,
|
||||
)
|
||||
from api_validations.defaults.validations import CommonHeaders
|
||||
|
||||
|
||||
# List all endpoint FL-REP
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
from api_initializer.event_clusters import EventCluster, RouterCluster
|
||||
from Initializer.event_clusters import EventCluster, RouterCluster
|
||||
from index import endpoints_index
|
||||
from .supers_events import (
|
||||
SuperLivingSpaceListEvent,
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
from typing import Any
|
||||
|
||||
from api_initializer.event_clusters import Event
|
||||
from api_validations.response import (
|
||||
from Initializer.event_clusters import Event
|
||||
from Validations.response import (
|
||||
PaginateOnly,
|
||||
Pagination,
|
||||
PaginationResult,
|
||||
@@ -9,12 +9,12 @@ from api_validations.response import (
|
||||
PostgresResponse,
|
||||
EndpointResponse
|
||||
)
|
||||
from schemas import (
|
||||
from Validations.defaults.validations import CommonHeaders
|
||||
from Schemas import (
|
||||
Build,
|
||||
BuildParts,
|
||||
AccountRecords,
|
||||
)
|
||||
from api_validations.defaults.validations import CommonHeaders
|
||||
|
||||
|
||||
# List all endpoint FL-REP
|
||||
|
||||
@@ -18,11 +18,11 @@ COPY /ServicesApi/Validations /Validations
|
||||
COPY /ServicesApi/Schemas /Schemas
|
||||
COPY /ServicesApi/Extensions /Extensions
|
||||
|
||||
COPY /ServicesApi/api_middlewares /api_middlewares
|
||||
COPY /ServicesApi/Builds/Identity/endpoints /Initializer/endpoints
|
||||
COPY /ServicesApi/Builds/Identity/events /Initializer/events
|
||||
COPY /ServicesApi/Builds/Identity/validations /Initializer/validations
|
||||
COPY /ServicesApi/Builds/Identity/index.py /Initializer/index.py
|
||||
# COPY /ServicesApi/api_middlewares /api_middlewares
|
||||
|
||||
# Set Python path to include app directory
|
||||
ENV PYTHONPATH=/ PYTHONUNBUFFERED=1 PYTHONDONTWRITEBYTECODE=1
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
from api_initializer.event_clusters import EventCluster, RouterCluster
|
||||
from Initializer.event_clusters import EventCluster, RouterCluster
|
||||
from index import endpoints_index
|
||||
from .supers_events import (
|
||||
SuperPeopleListEvent,
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
from typing import Any
|
||||
|
||||
from api_initializer.event_clusters import Event
|
||||
from api_validations.response import (
|
||||
from Initializer.event_clusters import Event
|
||||
from Validations.response import (
|
||||
PaginateOnly,
|
||||
Pagination,
|
||||
PaginationResult,
|
||||
@@ -9,8 +9,8 @@ from api_validations.response import (
|
||||
PostgresResponse,
|
||||
EndpointResponse
|
||||
)
|
||||
from api_validations.token.validations import TokenDictType
|
||||
from schemas import (
|
||||
from Validations.token.validations import TokenDictType
|
||||
from Schemas import (
|
||||
Build,
|
||||
BuildLivingSpace,
|
||||
BuildParts,
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
from api_initializer.event_clusters import EventCluster, RouterCluster
|
||||
from Initializer.event_clusters import EventCluster, RouterCluster
|
||||
from index import endpoints_index
|
||||
from .supers_events import (
|
||||
SuperUserListEvent,
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
from typing import Any
|
||||
|
||||
from api_initializer.event_clusters import Event
|
||||
from api_validations.response import (
|
||||
from Initializer.event_clusters import Event
|
||||
from Validations.response import (
|
||||
PaginateOnly,
|
||||
Pagination,
|
||||
PaginationResult,
|
||||
@@ -9,8 +9,8 @@ from api_validations.response import (
|
||||
PostgresResponse,
|
||||
EndpointResponse
|
||||
)
|
||||
from api_validations.token.validations import TokenDictType
|
||||
from schemas import (
|
||||
from Validations.token.validations import TokenDictType
|
||||
from Schemas import (
|
||||
Build,
|
||||
BuildLivingSpace,
|
||||
BuildParts,
|
||||
|
||||
@@ -6,8 +6,8 @@ from sqlalchemy import pool
|
||||
from sqlalchemy import create_engine
|
||||
|
||||
from alembic import context
|
||||
from schemas import *
|
||||
from api_controllers.postgres.engine import Base
|
||||
from Schemas import *
|
||||
from Controllers.Postgres.engine import Base
|
||||
|
||||
# this is the Alembic Config object, which provides
|
||||
# access to the values within the .ini file in use.
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
from schemas import (
|
||||
from Schemas import (
|
||||
Addresses,
|
||||
AddressCity,
|
||||
AddressStreet,
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import arrow
|
||||
|
||||
from api_modules.token.password_module import PasswordModule
|
||||
from api_controllers.mongo.database import mongo_handler
|
||||
from schemas import (
|
||||
from Extensions.Token.password_module import PasswordModule
|
||||
from Controllers.Mongo.database import mongo_handler
|
||||
from Schemas import (
|
||||
Companies,
|
||||
Departments,
|
||||
Duty,
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
from pydantic import BaseModel
|
||||
from schemas import BuildTypes, ApiEnumDropdown
|
||||
from Schemas import BuildTypes, ApiEnumDropdown
|
||||
|
||||
|
||||
class InsertBuildTypes(BaseModel):
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import arrow
|
||||
from api_modules.token.password_module import PasswordModule
|
||||
from api_controllers.mongo.database import mongo_handler
|
||||
from schemas import (
|
||||
from Extensions.Token.password_module import PasswordModule
|
||||
from Controllers.Mongo.database import mongo_handler
|
||||
from Schemas import (
|
||||
Addresses,
|
||||
BuildLivingSpace,
|
||||
Users,
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
from schemas import OccupantTypes
|
||||
from Schemas import OccupantTypes
|
||||
|
||||
|
||||
def create_occupant_types_defaults(db_session):
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
from schemas import (
|
||||
from Schemas import (
|
||||
Duty,
|
||||
OccupantTypes,
|
||||
Modules,
|
||||
|
||||
@@ -18,11 +18,11 @@ COPY /ServicesApi/Validations /Validations
|
||||
COPY /ServicesApi/Schemas /Schemas
|
||||
COPY /ServicesApi/Extensions /Extensions
|
||||
|
||||
COPY /ServicesApi/api_middlewares /api_middlewares
|
||||
COPY /ServicesApi/Builds/Management/endpoints /Initializer/endpoints
|
||||
COPY /ServicesApi/Builds/Management/events /Initializer/events
|
||||
COPY /ServicesApi/Builds/Management/validations /Initializer/validations
|
||||
COPY /ServicesApi/Builds/Management/index.py /Initializer/index.py
|
||||
# COPY /ServicesApi/api_middlewares /api_middlewares
|
||||
|
||||
# Set Python path to include app directory
|
||||
ENV PYTHONPATH=/ PYTHONUNBUFFERED=1 PYTHONDONTWRITEBYTECODE=1
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
from fastapi import APIRouter
|
||||
from .events.router import event_endpoint_route
|
||||
from .services.router import services_endpoint_route
|
||||
from .services.router import services_route
|
||||
from .application.router import application_endpoint_route
|
||||
|
||||
def get_routes() -> list[APIRouter]:
|
||||
return [event_endpoint_route, application_endpoint_route, services_endpoint_route]
|
||||
return [event_endpoint_route, application_endpoint_route, services_route]
|
||||
|
||||
|
||||
def get_safe_endpoint_urls() -> list[tuple[str, str]]:
|
||||
|
||||
@@ -19,7 +19,7 @@ services_list = "ServicesList"
|
||||
description="List all services endpoint",
|
||||
operation_id=endpoints_index[services_list],
|
||||
)
|
||||
def services_list(data: PaginateOnly, headers: CommonHeaders = Depends(CommonHeaders)):
|
||||
def services_list(data: PaginateOnly, headers: CommonHeaders = Depends(CommonHeaders.as_dependency)):
|
||||
token_object = TokenProvider.get_dict_from_redis(token=headers.token)
|
||||
event_founder_dict = dict(endpoint_code=headers.operation_id, token=token_object)
|
||||
event_key = TokenProvider.retrieve_event_codes(**event_founder_dict)
|
||||
@@ -34,7 +34,7 @@ services_create = "ServicesCreate"
|
||||
description="Create service endpoint",
|
||||
operation_id=endpoints_index[services_create],
|
||||
)
|
||||
def services_create(data, headers: CommonHeaders = Depends(CommonHeaders)):
|
||||
def services_create(data: dict, headers: CommonHeaders = Depends(CommonHeaders.as_dependency)):
|
||||
token_object = TokenProvider.get_dict_from_redis(token=headers.token)
|
||||
event_founder_dict = dict(endpoint_code=headers.operation_id, token=token_object)
|
||||
event_key = TokenProvider.retrieve_event_codes(**event_founder_dict)
|
||||
@@ -49,7 +49,7 @@ services_update = "ServicesUpdate"
|
||||
description="Update service endpoint",
|
||||
operation_id=endpoints_index[services_update],
|
||||
)
|
||||
def services_update(uu_id: str, data, headers: CommonHeaders = Depends(CommonHeaders)):
|
||||
def services_update(uu_id: str, data: dict, headers: CommonHeaders = Depends(CommonHeaders.as_dependency)):
|
||||
token_object = TokenProvider.get_dict_from_redis(token=headers.token)
|
||||
event_founder_dict = dict(endpoint_code=headers.operation_id, token=token_object)
|
||||
event_key = TokenProvider.retrieve_event_codes(**event_founder_dict)
|
||||
@@ -64,7 +64,7 @@ services_delete = "ServicesDelete"
|
||||
description="Delete service endpoint",
|
||||
operation_id=endpoints_index[services_delete],
|
||||
)
|
||||
def services_delete(uu_id: str, headers: CommonHeaders = Depends(CommonHeaders)):
|
||||
def services_delete(uu_id: str, headers: CommonHeaders = Depends(CommonHeaders.as_dependency)):
|
||||
token_object = TokenProvider.get_dict_from_redis(token=headers.token)
|
||||
event_founder_dict = dict(endpoint_code=headers.operation_id, token=token_object)
|
||||
event_key = TokenProvider.retrieve_event_codes(**event_founder_dict)
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
from typing import Any
|
||||
from fastapi import APIRouter, Depends
|
||||
from sqlalchemy import func
|
||||
from schemas import AccountRecords
|
||||
from Schemas import AccountRecords
|
||||
|
||||
from endpoints.index import endpoints_index
|
||||
from events.event_endpoints.cluster import EventsEndpointRouterCluster
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
from api_initializer.event_clusters import EventCluster, RouterCluster
|
||||
from Initializer.event_clusters import EventCluster, RouterCluster
|
||||
from index import endpoints_index
|
||||
from .supers_events import (
|
||||
ApplicationListAllEvent,
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
from typing import Any
|
||||
|
||||
from api_initializer.event_clusters import Event
|
||||
from api_validations.response import (
|
||||
from Initializer.event_clusters import Event
|
||||
from Validations.response import (
|
||||
PaginateOnly,
|
||||
Pagination,
|
||||
PaginationResult,
|
||||
@@ -10,7 +10,7 @@ from api_validations.response import (
|
||||
EndpointResponse
|
||||
)
|
||||
|
||||
from schemas import (
|
||||
from Schemas import (
|
||||
Applications,
|
||||
Application2Employee,
|
||||
Application2Occupant,
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
from api_initializer.event_clusters import EventCluster, RouterCluster
|
||||
from Initializer.event_clusters import EventCluster, RouterCluster
|
||||
from index import endpoints_index
|
||||
from .supers_events import (
|
||||
EventsListAvailableEvent,
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
from typing import Any
|
||||
|
||||
from api_initializer.event_clusters import Event
|
||||
from api_validations.response import (
|
||||
from Initializer.event_clusters import Event
|
||||
from Validations.response import (
|
||||
PaginateOnly,
|
||||
Pagination,
|
||||
PaginationResult,
|
||||
@@ -10,7 +10,7 @@ from api_validations.response import (
|
||||
EndpointResponse
|
||||
)
|
||||
|
||||
from schemas import (
|
||||
from Schemas import (
|
||||
Events,
|
||||
Event2Employee,
|
||||
Event2Occupant,
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
from api_initializer.event_clusters import EventCluster, RouterCluster
|
||||
from Initializer.event_clusters import EventCluster, RouterCluster
|
||||
from index import endpoints_index
|
||||
from .supers_events import (
|
||||
SuperServiceListEvent,
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
from typing import Any
|
||||
|
||||
from api_validations.defaults.validations import CommonHeaders
|
||||
from api_initializer.event_clusters import Event
|
||||
from api_validations.response import (
|
||||
from Validations.defaults.validations import CommonHeaders
|
||||
from Initializer.event_clusters import Event
|
||||
from Validations.response import (
|
||||
PaginateOnly,
|
||||
Pagination,
|
||||
PaginationResult,
|
||||
@@ -10,7 +10,7 @@ from api_validations.response import (
|
||||
PostgresResponse,
|
||||
EndpointResponse
|
||||
)
|
||||
from schemas import (
|
||||
from Schemas import (
|
||||
Events,
|
||||
Event2Employee,
|
||||
Event2Occupant,
|
||||
|
||||
@@ -18,11 +18,11 @@ COPY /ServicesApi/Validations /Validations
|
||||
COPY /ServicesApi/Schemas /Schemas
|
||||
COPY /ServicesApi/Extensions /Extensions
|
||||
|
||||
COPY /ServicesApi/api_middlewares /api_middlewares
|
||||
COPY /ServicesApi/Builds/Restriction/endpoints /Initializer/endpoints
|
||||
COPY /ServicesApi/Builds/Restriction/events /Initializer/events
|
||||
COPY /ServicesApi/Builds/Restriction/validations /Initializer/validations
|
||||
COPY /ServicesApi/Builds/Restriction/index.py /Initializer/index.py
|
||||
# COPY /ServicesApi/api_middlewares /api_middlewares
|
||||
|
||||
# Set Python path to include app directory
|
||||
ENV PYTHONPATH=/ PYTHONUNBUFFERED=1 PYTHONDONTWRITEBYTECODE=1
|
||||
|
||||
@@ -2,9 +2,8 @@ from fastapi import APIRouter, Depends
|
||||
|
||||
from events.pages.events import PageHandlers
|
||||
from index import endpoints_index
|
||||
|
||||
from Validations.defaults.validations import CommonHeaders
|
||||
from validations.request.restrictions.validations import RequestApplication
|
||||
from api_validations.defaults.validations import CommonHeaders
|
||||
|
||||
|
||||
pages_route = APIRouter(prefix="/restrictions", tags=["Restrictions Cluster"])
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
from api_modules.redis.redis_handlers import RedisHandlers
|
||||
from Extensions.OnMemory.redis_handlers import RedisHandlers
|
||||
|
||||
|
||||
class PageHandlers:
|
||||
|
||||
@@ -3,6 +3,7 @@ import datetime
|
||||
from typing import Any
|
||||
from fastapi import APIRouter, Depends
|
||||
from pydantic import BaseModel
|
||||
|
||||
from Validations.response import PaginateOnly, Pagination, PaginationResult, EndpointResponse
|
||||
from Validations.defaults.validations import CommonHeaders
|
||||
from Schemas import AccountRecords
|
||||
|
||||
Reference in New Issue
Block a user