language models accounts are updated
This commit is contained in:
parent
45ed5b86fd
commit
2c5b6956c8
|
|
@ -6,7 +6,12 @@
|
||||||
<component name="ChangeListManager">
|
<component name="ChangeListManager">
|
||||||
<list default="true" id="b5202e0c-6ddf-4a56-a13a-e18798c4c7cf" name="Changes" comment="">
|
<list default="true" id="b5202e0c-6ddf-4a56-a13a-e18798c4c7cf" name="Changes" comment="">
|
||||||
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
|
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
|
||||||
<change beforePath="$PROJECT_DIR$/Events/AllEvents/validations/validation/function_handlers.py" beforeDir="false" afterPath="$PROJECT_DIR$/Events/AllEvents/validations/validation/function_handlers.py" afterDir="false" />
|
<change beforePath="$PROJECT_DIR$/Events/AllEvents/authentication/auth/function_handlers.py" beforeDir="false" afterPath="$PROJECT_DIR$/Events/AllEvents/authentication/auth/function_handlers.py" afterDir="false" />
|
||||||
|
<change beforePath="$PROJECT_DIR$/Events/AllEvents/events/account/cluster.py" beforeDir="false" afterPath="$PROJECT_DIR$/Events/AllEvents/events/account/cluster.py" afterDir="false" />
|
||||||
|
<change beforePath="$PROJECT_DIR$/Events/AllEvents/events/account/function_handlers.py" beforeDir="false" afterPath="$PROJECT_DIR$/Events/AllEvents/events/account/function_handlers.py" afterDir="false" />
|
||||||
|
<change beforePath="$PROJECT_DIR$/Events/AllEvents/events/account/info.py" beforeDir="false" afterPath="$PROJECT_DIR$/Events/AllEvents/events/account/info.py" afterDir="false" />
|
||||||
|
<change beforePath="$PROJECT_DIR$/Events/Engine/abstract_class.py" beforeDir="false" afterPath="$PROJECT_DIR$/Events/Engine/abstract_class.py" afterDir="false" />
|
||||||
|
<change beforePath="$PROJECT_DIR$/Events/base_request_model.py" beforeDir="false" afterPath="$PROJECT_DIR$/Events/base_request_model.py" afterDir="false" />
|
||||||
</list>
|
</list>
|
||||||
<option name="SHOW_DIALOG" value="false" />
|
<option name="SHOW_DIALOG" value="false" />
|
||||||
<option name="HIGHLIGHT_CONFLICTS" value="true" />
|
<option name="HIGHLIGHT_CONFLICTS" value="true" />
|
||||||
|
|
|
||||||
|
|
@ -225,8 +225,12 @@ class AuthenticationFunctions(BaseRouteModel):
|
||||||
request: FastAPI request object
|
request: FastAPI request object
|
||||||
data: Request body containing login credentials
|
data: Request body containing login credentials
|
||||||
{
|
{
|
||||||
"domain": "evyos.com.tr", "access_key": "karatay.berkay.sup@evyos.com.tr",
|
"data": {
|
||||||
"password": "string", "remember_me": false
|
"domain": "evyos.com.tr",
|
||||||
|
"access_key": "karatay.berkay.sup@evyos.com.tr",
|
||||||
|
"password": "string",
|
||||||
|
"remember_me": false
|
||||||
|
}
|
||||||
}
|
}
|
||||||
Returns:
|
Returns:
|
||||||
SuccessResponse containing authentication token and user info
|
SuccessResponse containing authentication token and user info
|
||||||
|
|
@ -247,6 +251,13 @@ class AuthenticationFunctions(BaseRouteModel):
|
||||||
"""
|
"""
|
||||||
Handle selection of company or occupant type
|
Handle selection of company or occupant type
|
||||||
{"data": {"build_living_space_uu_id": ""}} | {"data": {"company_uu_id": ""}}
|
{"data": {"build_living_space_uu_id": ""}} | {"data": {"company_uu_id": ""}}
|
||||||
|
{
|
||||||
|
"data": {"company_uu_id": "e9869a25-ba4d-49dc-bb0d-8286343b184b"}
|
||||||
|
}
|
||||||
|
|
||||||
|
{
|
||||||
|
"data": {"build_living_space_uu_id": "e9869a25-ba4d-49dc-bb0d-8286343b184b"}
|
||||||
|
}
|
||||||
"""
|
"""
|
||||||
selection_dict = dict(
|
selection_dict = dict(
|
||||||
request=cls.context_retriever.request,
|
request=cls.context_retriever.request,
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,33 @@
|
||||||
|
from Events.Engine.abstract_class import DefaultClusterName
|
||||||
|
|
||||||
|
|
||||||
|
cluster_name = "AccountCluster"
|
||||||
|
prefix = "/accounts"
|
||||||
|
icon = "Building"
|
||||||
|
|
||||||
|
|
||||||
|
# Keys for the cluster
|
||||||
|
class KeyValidations:
|
||||||
|
headers = "headers"
|
||||||
|
data = "data"
|
||||||
|
validation = "validations"
|
||||||
|
|
||||||
|
|
||||||
|
# Keys for the cluster
|
||||||
|
class KeyBases:
|
||||||
|
create_key = f"{prefix}/create"
|
||||||
|
update_key = f"{prefix}/update"
|
||||||
|
list_key = f"{prefix}/list"
|
||||||
|
|
||||||
|
|
||||||
|
# Page Variations of the cluster
|
||||||
|
class PageBases:
|
||||||
|
CREATE = f"/create?{DefaultClusterName}={cluster_name}"
|
||||||
|
UPDATE = f"/update?{DefaultClusterName}={cluster_name}"
|
||||||
|
DASHBOARD = f"/dashboard?{DefaultClusterName}={cluster_name}"
|
||||||
|
|
||||||
|
|
||||||
|
class Page2Keys:
|
||||||
|
KeyBases.create_key = PageBases.CREATE
|
||||||
|
KeyBases.update_key = PageBases.UPDATE
|
||||||
|
KeyBases.list_key = PageBases.DASHBOARD
|
||||||
|
|
@ -1,23 +1,23 @@
|
||||||
from Events.Engine.abstract_class import CategoryCluster
|
from Events.Engine.abstract_class import CategoryCluster
|
||||||
|
|
||||||
from .account_records import (
|
from .account_records import (
|
||||||
AccountRecordsListEventMethods,
|
AccountRecordsListEventMethods,
|
||||||
AccountRecordsCreateEventMethods,
|
AccountRecordsCreateEventMethods,
|
||||||
AccountRecordsUpdateEventMethods,
|
AccountRecordsUpdateEventMethods,
|
||||||
)
|
)
|
||||||
from .info import account_page_info
|
from .bases import cluster_name, prefix
|
||||||
|
from .info import page_infos
|
||||||
|
|
||||||
|
|
||||||
AccountCluster = CategoryCluster(
|
AccountCluster = CategoryCluster(
|
||||||
name="AccountCluster",
|
name=cluster_name,
|
||||||
tags=["Account Records"],
|
tags=["Account Records"],
|
||||||
prefix="/accounts",
|
prefix=prefix,
|
||||||
description="Account Cluster",
|
description="Account Cluster Actions",
|
||||||
pageinfo=account_page_info,
|
pageinfo=page_infos,
|
||||||
endpoints={
|
endpoints={
|
||||||
"AccountRecordsListEventMethods": AccountRecordsListEventMethods,
|
|
||||||
"AccountRecordsCreateEventMethods": AccountRecordsCreateEventMethods,
|
"AccountRecordsCreateEventMethods": AccountRecordsCreateEventMethods,
|
||||||
"AccountRecordsUpdateEventMethods": AccountRecordsUpdateEventMethods,
|
"AccountRecordsUpdateEventMethods": AccountRecordsUpdateEventMethods,
|
||||||
|
"AccountRecordsListEventMethods": AccountRecordsListEventMethods,
|
||||||
},
|
},
|
||||||
include_in_schema=True,
|
include_in_schema=True,
|
||||||
sub_category=[],
|
sub_category=[],
|
||||||
|
|
|
||||||
|
|
@ -158,7 +158,7 @@ class AccountUpdateEventMethods(BaseRouteModel):
|
||||||
AccountRecords.build_parts_id = (
|
AccountRecords.build_parts_id = (
|
||||||
cls.context_retriever.token.selected_occupant.build_part_id
|
cls.context_retriever.token.selected_occupant.build_part_id
|
||||||
)
|
)
|
||||||
account_record = AccountRecords.update_one(build_uu_id, data).data
|
|
||||||
# return AlchemyJsonResponse(
|
# return AlchemyJsonResponse(
|
||||||
# completed=True,
|
# completed=True,
|
||||||
# message="Account record updated successfully",
|
# message="Account record updated successfully",
|
||||||
|
|
|
||||||
|
|
@ -1,116 +1,26 @@
|
||||||
from Events.Engine.abstract_class import PageInfo
|
from Events.Engine.abstract_class import PageInfo
|
||||||
|
from .bases import KeyValidations, cluster_name, KeyBases, PageBases, icon
|
||||||
from .account_records import (
|
from .account_records import (
|
||||||
AccountRecordsUpdateEventMethods,
|
AccountRecordsUpdateEventMethods,
|
||||||
AccountRecordsCreateEventMethods,
|
AccountRecordsCreateEventMethods,
|
||||||
AccountRecordsListEventMethods,
|
AccountRecordsListEventMethods,
|
||||||
)
|
)
|
||||||
|
from .lang_models import (
|
||||||
|
account_language_create_models_as_dict,
|
||||||
cluster_name = "AccountCluster"
|
account_language_model_as_dict,
|
||||||
prefix = "/accounts"
|
account_language_list_models_as_dict,
|
||||||
|
account_language_created_models_as_dict,
|
||||||
|
account_language_update_form_models_as_dict,
|
||||||
class LanguageModels:
|
|
||||||
SITE_URL: str
|
|
||||||
COMPONENT: str = "Table"
|
|
||||||
PREFIX_URL: str = ""
|
|
||||||
PAGE_INFO: dict
|
|
||||||
STATIC_PATH: str = "events"
|
|
||||||
|
|
||||||
def as_dict(self):
|
|
||||||
return {
|
|
||||||
"SITE_URL": f"/{self.STATIC_PATH}{self.SITE_URL}",
|
|
||||||
"COMPONENT": self.COMPONENT,
|
|
||||||
"PREFIX_URL": self.PREFIX_URL,
|
|
||||||
"PAGE_INFO": self.PAGE_INFO,
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
create_key = f"{prefix}{AccountRecordsCreateEventMethods.URL}"
|
|
||||||
update_key = f"{prefix}{AccountRecordsUpdateEventMethods.URL}"
|
|
||||||
list_key = f"{prefix}{AccountRecordsListEventMethods.URL}"
|
|
||||||
|
|
||||||
|
|
||||||
account_language_update_models = LanguageModels()
|
|
||||||
account_language_update_models.COMPONENT = "Link"
|
|
||||||
account_language_update_models.SITE_URL = f"/update?site={cluster_name}"
|
|
||||||
account_language_update_models.PREFIX_URL = (
|
|
||||||
update_key
|
|
||||||
)
|
|
||||||
account_language_update_models.PAGE_INFO = {
|
|
||||||
"en": {
|
|
||||||
"page": "Update Account Records",
|
|
||||||
},
|
|
||||||
"tr": {
|
|
||||||
"page": "Hesap Kayıdı Güncelle",
|
|
||||||
},
|
|
||||||
}
|
|
||||||
account_language_model_as_dict = account_language_update_models.as_dict()
|
|
||||||
|
|
||||||
|
|
||||||
account_language_created_models = LanguageModels()
|
|
||||||
account_language_created_models.COMPONENT = "Link"
|
|
||||||
account_language_created_models.SITE_URL = f"/create?site={cluster_name}"
|
|
||||||
account_language_created_models.PREFIX_URL = (
|
|
||||||
create_key
|
|
||||||
)
|
|
||||||
account_language_created_models.PAGE_INFO = {
|
|
||||||
"en": {
|
|
||||||
"page": "Create Account Records",
|
|
||||||
},
|
|
||||||
"tr": {"page": "Hesap Kayıdı Oluştur"},
|
|
||||||
}
|
|
||||||
account_language_created_models_as_dict = account_language_created_models.as_dict()
|
|
||||||
|
|
||||||
account_language_list_models = LanguageModels()
|
|
||||||
account_language_list_models.COMPONENT = "Table"
|
|
||||||
account_language_list_models.SITE_URL = f"/dashboard?site={cluster_name}"
|
|
||||||
account_language_list_models.PREFIX_URL = (
|
|
||||||
list_key
|
|
||||||
)
|
|
||||||
account_language_list_models.PAGE_INFO = {
|
|
||||||
"en": {
|
|
||||||
"page": "List Account Records",
|
|
||||||
},
|
|
||||||
"tr": {
|
|
||||||
"page": "Hesap Kayıtlarını Listele",
|
|
||||||
},
|
|
||||||
}
|
|
||||||
|
|
||||||
account_language_list_models_as_dict = account_language_list_models.as_dict()
|
|
||||||
|
|
||||||
account_language_create_models = LanguageModels()
|
|
||||||
account_language_create_models.COMPONENT = "Form"
|
|
||||||
account_language_create_models.SITE_URL = f"/create?site={cluster_name}"
|
|
||||||
account_language_create_models.PREFIX_URL = (
|
|
||||||
create_key
|
|
||||||
)
|
|
||||||
account_language_create_models.PAGE_INFO = {
|
|
||||||
"en": {"page": "List Account Records", "button:": "Create"},
|
|
||||||
"tr": {"page": "Hesap Kayıtlarını Listele", "button:": "Oluştur"},
|
|
||||||
}
|
|
||||||
|
|
||||||
account_language_create_models_as_dict = account_language_create_models.as_dict()
|
|
||||||
|
|
||||||
account_language_update_form_models = LanguageModels()
|
|
||||||
account_language_update_form_models.COMPONENT = "Form"
|
|
||||||
account_language_update_form_models.SITE_URL = f"/update?site={cluster_name}"
|
|
||||||
account_language_update_form_models.PREFIX_URL = (
|
|
||||||
update_key
|
|
||||||
)
|
|
||||||
account_language_update_form_models.PAGE_INFO = {
|
|
||||||
"en": {"page": "Update Account Records", "button:": "Update"},
|
|
||||||
"tr": {"page": "Hesap Kayıdı Güncelle", "button:": "Güncelle"},
|
|
||||||
}
|
|
||||||
account_language_update_form_models_as_dict = (
|
|
||||||
account_language_update_form_models.as_dict()
|
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
class ClustersPageInfo:
|
||||||
|
|
||||||
|
# Cluster Page Infos that are available for the client
|
||||||
dashboard_page_info = PageInfo(
|
dashboard_page_info = PageInfo(
|
||||||
name=f"{cluster_name}",
|
name=f"{cluster_name}",
|
||||||
url=f"/dashboard?site={cluster_name}",
|
url=PageBases.DASHBOARD,
|
||||||
icon="Building",
|
icon=icon,
|
||||||
page_info={
|
page_info={
|
||||||
"en": {
|
"en": {
|
||||||
"page": "Account Records for reaching user all types account information",
|
"page": "Account Records for reaching user all types account information",
|
||||||
|
|
@ -120,48 +30,48 @@ dashboard_page_info = PageInfo(
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
instructions={
|
instructions={
|
||||||
str(list_key): {
|
str(KeyBases.list_key): {
|
||||||
"headers": {
|
"headers": {
|
||||||
"store": True,
|
"store": True,
|
||||||
"url": "/validations/header",
|
"url": "/validations/header",
|
||||||
"data": {"event_code": f"{prefix}/list", "asked_field": "headers"},
|
"data": {"event_code": f"{KeyBases.list_key}", "asked_field": KeyValidations.headers},
|
||||||
},
|
},
|
||||||
"data": {
|
"data": {
|
||||||
"store": True,
|
"store": True,
|
||||||
"url": f"{prefix}/list",
|
"url": f"{KeyBases.list_key}",
|
||||||
"data": dict(page=1, limit=1),
|
"data": dict(page=1, limit=1),
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
endpoints={
|
endpoints={
|
||||||
str(update_key): AccountRecordsUpdateEventMethods.retrieve_all_event_keys(),
|
str(KeyBases.update_key): AccountRecordsUpdateEventMethods.retrieve_all_event_keys(),
|
||||||
str(create_key): AccountRecordsCreateEventMethods.retrieve_all_event_keys(),
|
str(KeyBases.create_key): AccountRecordsCreateEventMethods.retrieve_all_event_keys(),
|
||||||
str(list_key): AccountRecordsListEventMethods.retrieve_all_event_keys(),
|
str(KeyBases.list_key): AccountRecordsListEventMethods.retrieve_all_event_keys(),
|
||||||
},
|
},
|
||||||
language_models={
|
language_models={
|
||||||
str(list_key): {
|
str(KeyBases.list_key): {
|
||||||
str(update_key): account_language_model_as_dict,
|
str(KeyBases.update_key): account_language_model_as_dict,
|
||||||
str(create_key): account_language_created_models_as_dict,
|
str(KeyBases.create_key): account_language_created_models_as_dict,
|
||||||
str(list_key): account_language_list_models_as_dict,
|
str(KeyBases.list_key): account_language_list_models_as_dict,
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
|
|
||||||
create_page_info = PageInfo(
|
create_page_info = PageInfo(
|
||||||
name=f"{cluster_name}",
|
name=f"{cluster_name}",
|
||||||
url=f"/create?site={cluster_name}",
|
url=PageBases.CREATE,
|
||||||
icon="Building",
|
icon=icon,
|
||||||
instructions={
|
instructions={
|
||||||
str(create_key): {
|
str(KeyBases.create_key): {
|
||||||
"validation": {
|
"validation": {
|
||||||
"store": True,
|
"store": True,
|
||||||
"url": "/validations/validation",
|
"url": "/validations/validation",
|
||||||
"data": {"event_code": f"{prefix}/create", "asked_field": "validation"},
|
"data": {"event_code": f"{KeyBases.create_key}", "asked_field": KeyValidations.validation },
|
||||||
},
|
},
|
||||||
"headers": {
|
"headers": {
|
||||||
"store": True,
|
"store": True,
|
||||||
"url": "/validations/header",
|
"url": "/validations/header",
|
||||||
"data": {"event_code": f"{prefix}/create", "asked_field": "headers"},
|
"data": {"event_code": f"{KeyBases.create_key}", "asked_field": KeyValidations.headers},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
@ -174,28 +84,29 @@ create_page_info = PageInfo(
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
endpoints={
|
endpoints={
|
||||||
str(create_key): AccountRecordsCreateEventMethods.retrieve_all_event_keys(),
|
str(KeyBases.create_key): AccountRecordsCreateEventMethods.retrieve_all_event_keys(),
|
||||||
},
|
},
|
||||||
language_models={
|
language_models={
|
||||||
str(create_key): account_language_create_models_as_dict,
|
str(KeyBases.create_key): account_language_create_models_as_dict,
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
update_page_info = PageInfo(
|
update_page_info = PageInfo(
|
||||||
name=f"{cluster_name}",
|
name=f"{cluster_name}",
|
||||||
url=f"/update?site={cluster_name}",
|
url=PageBases.UPDATE,
|
||||||
icon="Building",
|
icon=icon,
|
||||||
instructions={
|
instructions={
|
||||||
str(update_key): {
|
str(KeyBases.update_key): {
|
||||||
"validation": {
|
"validation": {
|
||||||
"store": True,
|
"store": True,
|
||||||
"url": "/validations/validation",
|
"url": "/validations/validation",
|
||||||
"data": {"event_code": f"{prefix}/update", "asked_field": "validation"},
|
"data": {"event_code": f"{KeyBases.update_key}", "asked_field": KeyValidations.validation},
|
||||||
},
|
},
|
||||||
"headers": {
|
"headers": {
|
||||||
"store": True,
|
"store": True,
|
||||||
"url": "/validations/header",
|
"url": "/validations/header",
|
||||||
"data": {"event_code": f"{prefix}/update", "asked_field": "headers"},
|
"data": {"event_code": f"{KeyBases.update_key}", "asked_field": KeyValidations.headers},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
@ -208,16 +119,23 @@ update_page_info = PageInfo(
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
endpoints={
|
endpoints={
|
||||||
str(update_key): AccountRecordsUpdateEventMethods.retrieve_all_event_keys(),
|
str(KeyBases.update_key): AccountRecordsUpdateEventMethods.retrieve_all_event_keys(),
|
||||||
},
|
},
|
||||||
language_models={
|
language_models={
|
||||||
str(update_key): account_language_update_form_models_as_dict,
|
str(KeyBases.update_key): account_language_update_form_models_as_dict,
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
account_page_info = {
|
# Page Variations of the cluster
|
||||||
f"/dashboard?site={cluster_name}": dashboard_page_info,
|
page_infos = {
|
||||||
f"/create?site={cluster_name}": create_page_info,
|
ClustersPageInfo.dashboard_page_info.URL: ClustersPageInfo.dashboard_page_info,
|
||||||
f"/update?site={cluster_name}": update_page_info,
|
ClustersPageInfo.create_page_info.URL: ClustersPageInfo.create_page_info,
|
||||||
|
ClustersPageInfo.update_page_info.URL: ClustersPageInfo.update_page_info,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
# Check if all the page info is implemented in the mappings
|
||||||
|
for t in [x for k, x in PageBases.__dict__.items() if not str(k).startswith("__")]:
|
||||||
|
if t not in list(dict(page_infos).keys()):
|
||||||
|
raise NotImplementedError(f"Page Info of : {t} is not implemented in mappings")
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,78 @@
|
||||||
|
from Events.Engine.abstract_class import DefaultClusterName, LanguageModels
|
||||||
|
from .bases import KeyBases, cluster_name
|
||||||
|
|
||||||
|
|
||||||
|
account_language_update_models = LanguageModels()
|
||||||
|
account_language_update_models.COMPONENT = "Link"
|
||||||
|
account_language_update_models.SITE_URL = f"/update?{DefaultClusterName}={cluster_name}"
|
||||||
|
account_language_update_models.PREFIX_URL = (
|
||||||
|
KeyBases.update_key
|
||||||
|
)
|
||||||
|
account_language_update_models.PAGE_INFO = {
|
||||||
|
"en": {
|
||||||
|
"page": "Update Account Records",
|
||||||
|
},
|
||||||
|
"tr": {
|
||||||
|
"page": "Hesap Kayıdı Güncelle",
|
||||||
|
},
|
||||||
|
}
|
||||||
|
account_language_model_as_dict = account_language_update_models.as_dict()
|
||||||
|
|
||||||
|
|
||||||
|
account_language_created_models = LanguageModels()
|
||||||
|
account_language_created_models.COMPONENT = "Link"
|
||||||
|
account_language_created_models.SITE_URL = f"/create?{DefaultClusterName}={cluster_name}"
|
||||||
|
account_language_created_models.PREFIX_URL = (
|
||||||
|
KeyBases.create_key
|
||||||
|
)
|
||||||
|
account_language_created_models.PAGE_INFO = {
|
||||||
|
"en": {
|
||||||
|
"page": "Create Account Records",
|
||||||
|
},
|
||||||
|
"tr": {"page": "Hesap Kayıdı Oluştur"},
|
||||||
|
}
|
||||||
|
account_language_created_models_as_dict = account_language_created_models.as_dict()
|
||||||
|
|
||||||
|
account_language_list_models = LanguageModels()
|
||||||
|
account_language_list_models.COMPONENT = "Table"
|
||||||
|
account_language_list_models.SITE_URL = f"/dashboard?{DefaultClusterName}={cluster_name}"
|
||||||
|
account_language_list_models.PREFIX_URL = (
|
||||||
|
KeyBases.list_key
|
||||||
|
)
|
||||||
|
account_language_list_models.PAGE_INFO = {
|
||||||
|
"en": {
|
||||||
|
"page": "List Account Records",
|
||||||
|
},
|
||||||
|
"tr": {
|
||||||
|
"page": "Hesap Kayıtlarını Listele",
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
account_language_list_models_as_dict = account_language_list_models.as_dict()
|
||||||
|
|
||||||
|
account_language_create_form_models = LanguageModels()
|
||||||
|
account_language_create_form_models.COMPONENT = "Form"
|
||||||
|
account_language_create_form_models.SITE_URL = f"/create?{DefaultClusterName}={cluster_name}"
|
||||||
|
account_language_create_form_models.PREFIX_URL = (
|
||||||
|
KeyBases.create_key
|
||||||
|
)
|
||||||
|
account_language_create_form_models.PAGE_INFO = {
|
||||||
|
"en": {"page": "List Account Records", "button:": "Create"},
|
||||||
|
"tr": {"page": "Hesap Kayıtlarını Listele", "button:": "Oluştur"},
|
||||||
|
}
|
||||||
|
|
||||||
|
account_language_create_models_as_dict = account_language_create_form_models.as_dict()
|
||||||
|
|
||||||
|
account_language_update_form_models = LanguageModels()
|
||||||
|
account_language_update_form_models.COMPONENT = "Form"
|
||||||
|
account_language_update_form_models.SITE_URL = f"/update?{DefaultClusterName}={cluster_name}"
|
||||||
|
account_language_update_form_models.PREFIX_URL = (
|
||||||
|
KeyBases.update_key
|
||||||
|
)
|
||||||
|
account_language_update_form_models.PAGE_INFO = {
|
||||||
|
"en": {"page": "Update Account Records", "button:": "Update"},
|
||||||
|
"tr": {"page": "Hesap Kayıdı Güncelle", "button:": "Güncelle"},
|
||||||
|
}
|
||||||
|
account_language_update_form_models_as_dict = (
|
||||||
|
account_language_update_form_models.as_dict()
|
||||||
|
)
|
||||||
|
|
@ -3,6 +3,7 @@ from typing import Any, Dict, List, Optional, Callable
|
||||||
from uuid import UUID
|
from uuid import UUID
|
||||||
|
|
||||||
from ApiLayers.AllConfigs.Redis.configs import RedisCategoryKeys
|
from ApiLayers.AllConfigs.Redis.configs import RedisCategoryKeys
|
||||||
|
from Events.base_request_model import STATIC_PATH
|
||||||
|
|
||||||
|
|
||||||
class PageComponent:
|
class PageComponent:
|
||||||
|
|
@ -351,3 +352,22 @@ class CategoryCluster:
|
||||||
if hasattr(self.PAGEINFO, "as_dict"):
|
if hasattr(self.PAGEINFO, "as_dict"):
|
||||||
return {"prefix": self.PREFIX, **self.PAGEINFO.as_dict}
|
return {"prefix": self.PREFIX, **self.PAGEINFO.as_dict}
|
||||||
return
|
return
|
||||||
|
|
||||||
|
|
||||||
|
class LanguageModels:
|
||||||
|
SITE_URL: str
|
||||||
|
COMPONENT: str = "Table"
|
||||||
|
PREFIX_URL: str = ""
|
||||||
|
PAGE_INFO: dict
|
||||||
|
STATIC_PATH: str = STATIC_PATH
|
||||||
|
|
||||||
|
def as_dict(self):
|
||||||
|
return {
|
||||||
|
"SITE_URL": f"/{self.STATIC_PATH}{self.SITE_URL}",
|
||||||
|
"COMPONENT": self.COMPONENT,
|
||||||
|
"PREFIX_URL": self.PREFIX_URL,
|
||||||
|
"PAGE_INFO": self.PAGE_INFO,
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
DefaultClusterName = "site"
|
||||||
|
|
@ -23,6 +23,7 @@ from Services.PostgresDb.Models.pagination import (
|
||||||
|
|
||||||
TokenDictType = Union[EmployeeTokenObject, OccupantTokenObject]
|
TokenDictType = Union[EmployeeTokenObject, OccupantTokenObject]
|
||||||
|
|
||||||
|
STATIC_PATH = "events"
|
||||||
|
|
||||||
class EndpointBaseRequestModel(BaseModel):
|
class EndpointBaseRequestModel(BaseModel):
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue