instructions and validations tested
This commit is contained in:
@@ -79,7 +79,9 @@ class RedisCategoryPageInfoKeysAction:
|
||||
value : {RedisCategoryPageInfoKeys.PAGE_INFO}
|
||||
"""
|
||||
|
||||
page_index: str = f"{RedisCategoryPageInfoKeys.PAGE_MENU_INDEX}:{RedisCategoryPageInfoKeys.PAGE_URL}"
|
||||
page_index: str = (
|
||||
f"{RedisCategoryPageInfoKeys.PAGE_MENU_INDEX}:{RedisCategoryPageInfoKeys.PAGE_URL}"
|
||||
)
|
||||
|
||||
page_mapper_key: str = (
|
||||
f"{RedisCategoryPageInfoKeys.PAGE_MENU_INDEX}:{RedisCategoryPageInfoKeys.PAGE_URL}"
|
||||
|
||||
227
ApiLayers/LanguageModels/Response/how_to.py
Normal file
227
ApiLayers/LanguageModels/Response/how_to.py
Normal file
@@ -0,0 +1,227 @@
|
||||
from Events.Engine import MethodToEvent
|
||||
from Events.Engine.abstract_class import PageInfo
|
||||
|
||||
# from .account_records import (
|
||||
# AccountRecordsUpdateEventMethods,
|
||||
# AccountRecordsCreateEventMethods,
|
||||
# AccountRecordsListEventMethods,
|
||||
# )
|
||||
|
||||
cluster_name = "AccountCluster"
|
||||
prefix = "/accounts"
|
||||
|
||||
|
||||
class AccountRecordsUpdateEventMethods(MethodToEvent):
|
||||
pass
|
||||
|
||||
|
||||
class AccountRecordsCreateEventMethods(MethodToEvent):
|
||||
pass
|
||||
|
||||
|
||||
class AccountRecordsListEventMethods(MethodToEvent):
|
||||
pass
|
||||
|
||||
|
||||
class LanguageModels:
|
||||
SITE_URL: str
|
||||
COMPONENT: str = "Table"
|
||||
PREFIX_URL: str = ""
|
||||
PAGE_INFO: dict
|
||||
|
||||
def as_dict(self):
|
||||
return {
|
||||
"SITE_URL": self.SITE_URL,
|
||||
"COMPONENT": self.COMPONENT,
|
||||
"PREFIX_URL": self.PREFIX_URL,
|
||||
"PAGE_INFO": self.PAGE_INFO,
|
||||
}
|
||||
|
||||
|
||||
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 = (
|
||||
f"{prefix}{AccountRecordsUpdateEventMethods.URL}"
|
||||
)
|
||||
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 = (
|
||||
f"{prefix}{AccountRecordsCreateEventMethods.URL}"
|
||||
)
|
||||
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"/list?site={cluster_name}"
|
||||
account_language_list_models.PREFIX_URL = (
|
||||
f"{prefix}{AccountRecordsListEventMethods.URL}"
|
||||
)
|
||||
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 = (
|
||||
f"{prefix}{AccountRecordsListEventMethods.URL}"
|
||||
)
|
||||
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 = (
|
||||
f"{prefix}{AccountRecordsUpdateEventMethods.URL}"
|
||||
)
|
||||
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()
|
||||
)
|
||||
|
||||
|
||||
create_key = f"{prefix}{AccountRecordsCreateEventMethods.URL}"
|
||||
update_key = f"{prefix}{AccountRecordsUpdateEventMethods.URL}"
|
||||
list_key = f"{prefix}{AccountRecordsListEventMethods.URL}"
|
||||
|
||||
|
||||
dashboard_page_info = PageInfo(
|
||||
name=f"{cluster_name}",
|
||||
url=f"/dashboard?site={cluster_name}",
|
||||
icon="Building",
|
||||
instructions={
|
||||
str(list_key): {
|
||||
"headers": {
|
||||
"store": True,
|
||||
"url": "/validations/header",
|
||||
"data": {"event_code": f"{prefix}/list", "asked_field": "headers"},
|
||||
},
|
||||
"data": {
|
||||
"store": True,
|
||||
"url": f"{prefix}/list",
|
||||
"data": dict(page=1, limit=1),
|
||||
},
|
||||
},
|
||||
},
|
||||
page_info={
|
||||
"page": {
|
||||
"en": "Account Records for reaching user all types account information",
|
||||
"tr": "Kullanıcı tüm hesap bilgilerine ulaşmak için Hesap Kayıtları",
|
||||
},
|
||||
},
|
||||
endpoints={
|
||||
str(update_key): AccountRecordsUpdateEventMethods.retrieve_all_event_keys(),
|
||||
str(create_key): AccountRecordsCreateEventMethods.retrieve_all_event_keys(),
|
||||
str(list_key): AccountRecordsListEventMethods.retrieve_all_event_keys(),
|
||||
},
|
||||
language_models={
|
||||
account_language_update_models.PREFIX_URL: account_language_model_as_dict,
|
||||
account_language_created_models.PREFIX_URL: account_language_created_models_as_dict,
|
||||
account_language_list_models.PREFIX_URL: account_language_list_models_as_dict,
|
||||
},
|
||||
)
|
||||
|
||||
create_page_info = PageInfo(
|
||||
name=f"{cluster_name}",
|
||||
url=f"/create?site={cluster_name}",
|
||||
icon="Building",
|
||||
instructions={
|
||||
str(create_key): {
|
||||
"validation": {
|
||||
"store": True,
|
||||
"url": "/validations/validation",
|
||||
"data": {"event_code": f"{prefix}/create", "asked_field": "validation"},
|
||||
},
|
||||
"headers": {
|
||||
"store": True,
|
||||
"url": "/validations/header",
|
||||
"data": {"event_code": f"{prefix}/create", "asked_field": "headers"},
|
||||
},
|
||||
},
|
||||
},
|
||||
page_info={
|
||||
"page": {
|
||||
"en": "Account Records creating for user all types account information",
|
||||
"tr": "Kullanıcı tüm hesap bilgilerine ulaşmak için Hesap Kayıtları oluştur",
|
||||
},
|
||||
},
|
||||
endpoints={
|
||||
str(create_key): AccountRecordsCreateEventMethods.retrieve_all_event_keys(),
|
||||
},
|
||||
language_models={
|
||||
account_language_create_models.PREFIX_URL: account_language_create_models_as_dict,
|
||||
},
|
||||
)
|
||||
|
||||
update_page_info = PageInfo(
|
||||
name=f"{cluster_name}",
|
||||
url=f"/update?site={cluster_name}",
|
||||
icon="Building",
|
||||
instructions={
|
||||
str(update_key): {
|
||||
"validation": {
|
||||
"store": True,
|
||||
"url": "/validations/validation",
|
||||
"data": {"event_code": f"{prefix}/update", "asked_field": "validation"},
|
||||
},
|
||||
"headers": {
|
||||
"store": True,
|
||||
"url": "/validations/header",
|
||||
"data": {"event_code": f"{prefix}/update", "asked_field": "headers"},
|
||||
},
|
||||
},
|
||||
},
|
||||
page_info={
|
||||
"page": {
|
||||
"en": "Account Records updating for user all types account information",
|
||||
"tr": "Kullanıcı tüm hesap bilgilerine ulaşmak için Hesap Kayıtları güncelle",
|
||||
},
|
||||
},
|
||||
endpoints={
|
||||
str(update_key): AccountRecordsUpdateEventMethods.retrieve_all_event_keys(),
|
||||
},
|
||||
language_models={
|
||||
account_language_update_form_models.PREFIX_URL: account_language_update_form_models_as_dict,
|
||||
},
|
||||
)
|
||||
|
||||
|
||||
account_page_info = {
|
||||
f"/dashboard?site={cluster_name}": dashboard_page_info,
|
||||
f"/create?site={cluster_name}": create_page_info,
|
||||
f"/update?site={cluster_name}": update_page_info,
|
||||
}
|
||||
Reference in New Issue
Block a user