updated tailwind css
This commit is contained in:
30
ServicesApi/Builds/Account/Dockerfile
Normal file
30
ServicesApi/Builds/Account/Dockerfile
Normal file
@@ -0,0 +1,30 @@
|
||||
FROM python:3.12-slim
|
||||
|
||||
WORKDIR /
|
||||
|
||||
# Install system dependencies and Poetry
|
||||
RUN apt-get update && apt-get install -y --no-install-recommends gcc && rm -rf /var/lib/apt/lists/* && pip install --no-cache-dir poetry
|
||||
|
||||
# Copy Poetry configuration
|
||||
COPY /pyproject.toml ./pyproject.toml
|
||||
|
||||
# Configure Poetry and install dependencies with optimizations
|
||||
RUN poetry config virtualenvs.create false && poetry install --no-interaction --no-ansi --no-root --only main && pip cache purge && rm -rf ~/.cache/pypoetry
|
||||
|
||||
# Copy application code
|
||||
COPY /ServicesApi/Initializer /Initializer
|
||||
COPY /ServicesApi/Controllers /Controllers
|
||||
COPY /ServicesApi/Validations /Validations
|
||||
COPY /ServicesApi/Schemas /Schemas
|
||||
COPY /ServicesApi/Extensions /Extensions
|
||||
|
||||
COPY /ServicesApi/Builds/Account/Endpoints /Initializer/Endpoints
|
||||
COPY /ServicesApi/Builds/Account/Events /Initializer/Events
|
||||
COPY /ServicesApi/Builds/Account/Validations /Initializer/Validations
|
||||
COPY /ServicesApi/Builds/Account/Index.py /Initializer/index.py
|
||||
|
||||
# Set Python path to include app directory
|
||||
ENV PYTHONPATH=/ PYTHONUNBUFFERED=1 PYTHONDONTWRITEBYTECODE=1
|
||||
|
||||
# Run the application using the configured uvicorn server
|
||||
CMD ["poetry", "run", "python", "/Initializer/app.py"]
|
||||
@@ -0,0 +1,72 @@
|
||||
from typing import Any
|
||||
from fastapi import APIRouter, Depends
|
||||
|
||||
from index import endpoints_index
|
||||
from events.account_records.cluster import AccountRecordsRouterCluster
|
||||
|
||||
from api_validations.defaults.validations import CommonHeaders
|
||||
from api_validations.response.pagination import PaginateOnly
|
||||
from api_middlewares.token_provider import TokenProvider
|
||||
|
||||
|
||||
account_records_router = APIRouter(prefix="/account/records", tags=["Account Cluster"])
|
||||
|
||||
|
||||
account_records_list = "AccountRecordsList"
|
||||
@account_records_router.post(
|
||||
path="/list",
|
||||
description="List all account records endpoint",
|
||||
operation_id=endpoints_index[account_records_list],
|
||||
)
|
||||
def people_list_route(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)
|
||||
FoundCluster = AccountRecordsRouterCluster.get_event_cluster(account_records_list)
|
||||
event_cluster_matched = FoundCluster.match_event(event_key=event_key)
|
||||
return event_cluster_matched.event_callable(list_options=data, header=headers)
|
||||
|
||||
|
||||
account_records_create = "AccountRecordsCreate"
|
||||
@account_records_router.post(
|
||||
path="/create",
|
||||
description="Create account records endpoint",
|
||||
operation_id=endpoints_index[account_records_create],
|
||||
)
|
||||
def account_records_create_route(data, 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)
|
||||
FoundCluster = AccountRecordsRouterCluster.get_event_cluster(account_records_create)
|
||||
event_cluster_matched = FoundCluster.match_event(event_key=event_key)
|
||||
return event_cluster_matched.event_callable(data=data, header=headers)
|
||||
|
||||
|
||||
account_records_update = "AccountRecordsUpdate"
|
||||
@account_records_router.post(
|
||||
path="/update/{uu_id}",
|
||||
description="Update account records endpoint",
|
||||
operation_id=endpoints_index[account_records_update],
|
||||
)
|
||||
def account_records_update_route(uu_id: str, data, 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)
|
||||
FoundCluster = AccountRecordsRouterCluster.get_event_cluster(account_records_update)
|
||||
event_cluster_matched = FoundCluster.match_event(event_key=event_key)
|
||||
return event_cluster_matched.event_callable(uu_id=uu_id, data=data, header=headers)
|
||||
|
||||
|
||||
account_records_delete = "AccountRecordsDelete"
|
||||
@account_records_router.post(
|
||||
path="/delete/{uu_id}",
|
||||
description="Delete account records endpoint",
|
||||
operation_id=endpoints_index[account_records_delete],
|
||||
)
|
||||
def account_records_delete_route(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)
|
||||
FoundCluster = AccountRecordsRouterCluster.get_event_cluster(account_records_delete)
|
||||
event_cluster_matched = FoundCluster.match_event(event_key=event_key)
|
||||
return event_cluster_matched.event_callable(uu_id=uu_id, header=headers)
|
||||
15
ServicesApi/Builds/Account/endpoints/routes.py
Normal file
15
ServicesApi/Builds/Account/endpoints/routes.py
Normal file
@@ -0,0 +1,15 @@
|
||||
from fastapi import APIRouter
|
||||
from .account_records.router import account_records_router
|
||||
|
||||
def get_routes() -> list[APIRouter]:
|
||||
return [account_records_router]
|
||||
|
||||
|
||||
def get_safe_endpoint_urls() -> list[tuple[str, str]]:
|
||||
return [
|
||||
("/", "GET"),
|
||||
("/docs", "GET"),
|
||||
("/redoc", "GET"),
|
||||
("/openapi.json", "GET"),
|
||||
("/metrics", "GET"),
|
||||
]
|
||||
5
ServicesApi/Builds/Account/events/__init__.py
Normal file
5
ServicesApi/Builds/Account/events/__init__.py
Normal file
@@ -0,0 +1,5 @@
|
||||
from .account_records.cluster import AccountRecordsRouterCluster
|
||||
|
||||
__all__ = [
|
||||
"AccountRecordsRouterCluster",
|
||||
]
|
||||
0
ServicesApi/Builds/Account/events/a.txt
Normal file
0
ServicesApi/Builds/Account/events/a.txt
Normal file
27
ServicesApi/Builds/Account/events/account_records/cluster.py
Normal file
27
ServicesApi/Builds/Account/events/account_records/cluster.py
Normal file
@@ -0,0 +1,27 @@
|
||||
from api_initializer.event_clusters import EventCluster, RouterCluster
|
||||
from index import endpoints_index
|
||||
from .supers_events import (
|
||||
SuperAccountRecordsListEvent,
|
||||
SuperAccountRecordsCreateEvent,
|
||||
SuperAccountRecordsUpdateEvent,
|
||||
SuperAccountRecordsDeleteEvent,
|
||||
)
|
||||
|
||||
AccountRecordsRouterCluster = RouterCluster(name="AccountRecordsRouterCluster")
|
||||
|
||||
AccountRecordsListEventCluster = EventCluster(name="AccountRecordsListEventCluster", endpoint_uu_id=endpoints_index["AccountRecordsList"])
|
||||
AccountRecordsListEventCluster.add_event(SuperAccountRecordsListEvent)
|
||||
|
||||
AccountRecordsCreateEventCluster = EventCluster(name="AccountRecordsCreateEventCluster", endpoint_uu_id=endpoints_index["AccountRecordsCreate"])
|
||||
AccountRecordsCreateEventCluster.add_event(SuperAccountRecordsCreateEvent)
|
||||
|
||||
AccountRecordsUpdateEventCluster = EventCluster(name="AccountRecordsUpdateEventCluster", endpoint_uu_id=endpoints_index["AccountRecordsUpdate"])
|
||||
AccountRecordsUpdateEventCluster.add_event(SuperAccountRecordsUpdateEvent)
|
||||
|
||||
AccountRecordsDeleteEventCluster = EventCluster(name="AccountRecordsDeleteEventCluster", endpoint_uu_id=endpoints_index["AccountRecordsDelete"])
|
||||
AccountRecordsDeleteEventCluster.add_event(SuperAccountRecordsDeleteEvent)
|
||||
|
||||
AccountRecordsRouterCluster.set_event_cluster(AccountRecordsListEventCluster)
|
||||
AccountRecordsRouterCluster.set_event_cluster(AccountRecordsCreateEventCluster)
|
||||
AccountRecordsRouterCluster.set_event_cluster(AccountRecordsUpdateEventCluster)
|
||||
AccountRecordsRouterCluster.set_event_cluster(AccountRecordsDeleteEventCluster)
|
||||
@@ -0,0 +1,93 @@
|
||||
from typing import Any
|
||||
|
||||
from api_initializer.event_clusters import Event
|
||||
from api_validations.response import (
|
||||
PaginateOnly,
|
||||
Pagination,
|
||||
PaginationResult,
|
||||
PostgresResponseSingle,
|
||||
PostgresResponse,
|
||||
EndpointResponse
|
||||
)
|
||||
from api_validations.defaults.validations import CommonHeaders
|
||||
from schemas import AccountRecords
|
||||
|
||||
# List all account records endpoint Super Users
|
||||
SuperAccountRecordsListEvent = Event(
|
||||
name="super_account_records_list",
|
||||
key="c5b6d9c7-9115-4825-bcc1-16f409a7004a",
|
||||
request_validator=None, # TODO: Add request validator
|
||||
response_validator=None, # TODO: Add response validator
|
||||
description="Super Account Records List all flat representative users endpoint",
|
||||
)
|
||||
|
||||
# Create account records endpoint Super Users
|
||||
SuperAccountRecordsCreateEvent = Event(
|
||||
name="super_account_records_create",
|
||||
key="1ab5c778-5a25-49d0-8bf8-799a74f430ad",
|
||||
request_validator=None, # TODO: Add request validator
|
||||
response_validator=None, # TODO: Add response validator
|
||||
description="Super Account Records Create endpoint",
|
||||
)
|
||||
|
||||
# Update account records endpoint Super Users
|
||||
SuperAccountRecordsUpdateEvent = Event(
|
||||
name="super_account_records_update",
|
||||
key="137fca9b-110a-4a28-bddd-36fde7380e89",
|
||||
request_validator=None, # TODO: Add request validator
|
||||
response_validator=None, # TODO: Add response validator
|
||||
description="Super Account Records Update endpoint",
|
||||
)
|
||||
|
||||
# Delete account records endpoint Super Users
|
||||
SuperAccountRecordsDeleteEvent = Event(
|
||||
name="super_account_records_delete",
|
||||
key="8bf399a7-f79e-49d2-b481-f5974676599f",
|
||||
request_validator=None, # TODO: Add request validator
|
||||
response_validator=None, # TODO: Add response validator
|
||||
description="Super Account Records Delete endpoint",
|
||||
)
|
||||
|
||||
|
||||
def super_account_records_list_callable(list_options: PaginateOnly, header: CommonHeaders):
|
||||
return {
|
||||
"message": "MSG0003-LIST",
|
||||
"data": None,
|
||||
"completed": True,
|
||||
}
|
||||
|
||||
|
||||
SuperAccountRecordsListEvent.event_callable = super_account_records_list_callable
|
||||
|
||||
|
||||
def super_account_records_create_callable(data: AccountRecords, header: CommonHeaders):
|
||||
return {
|
||||
"message": "MSG0003-CREATE",
|
||||
"data": None,
|
||||
"completed": True,
|
||||
}
|
||||
|
||||
|
||||
SuperAccountRecordsCreateEvent.event_callable = super_account_records_create_callable
|
||||
|
||||
|
||||
def super_account_records_update_callable(data: AccountRecords, header: CommonHeaders):
|
||||
return {
|
||||
"message": "MSG0003-UPDATE",
|
||||
"data": None,
|
||||
"completed": True,
|
||||
}
|
||||
|
||||
|
||||
SuperAccountRecordsUpdateEvent.event_callable = super_account_records_update_callable
|
||||
|
||||
|
||||
def super_account_records_delete_callable(data: AccountRecords, header: CommonHeaders):
|
||||
return {
|
||||
"message": "MSG0003-DELETE",
|
||||
"data": None,
|
||||
"completed": True,
|
||||
}
|
||||
|
||||
|
||||
SuperAccountRecordsDeleteEvent.event_callable = super_account_records_delete_callable
|
||||
8
ServicesApi/Builds/Account/index.py
Normal file
8
ServicesApi/Builds/Account/index.py
Normal file
@@ -0,0 +1,8 @@
|
||||
|
||||
|
||||
endpoints_index: dict = {
|
||||
"AccountRecordsList": "7552d270-0e2a-4a40-bfd5-ec3493bc63ab",
|
||||
"AccountRecordsCreate": "ddb956fb-73ef-4eec-a51b-ff54c3d65552",
|
||||
"AccountRecordsUpdate": "6f120aca-b5a7-43ea-8214-9c17f9333c8a",
|
||||
"AccountRecordsDelete": "5cc1de2d-de11-4bbe-9c19-5b8eec69e4a1",
|
||||
}
|
||||
Reference in New Issue
Block a user