78 lines
2.3 KiB
Python
78 lines
2.3 KiB
Python
from Events.Engine.abstract_class import Event
|
|
|
|
from .models import AccountRequestValidators
|
|
from .function_handlers import (
|
|
AccountListEventMethods,
|
|
AccountCreateEventMethods,
|
|
AccountUpdateEventMethods,
|
|
)
|
|
|
|
|
|
# class SelectResponseAccount(BaseModel):
|
|
# """
|
|
# Response model for account list.
|
|
# """
|
|
# neighborhood_code: str
|
|
# neighborhood_name: str
|
|
# type_code: str
|
|
# type_description: str
|
|
#
|
|
|
|
|
|
# Auth Login
|
|
account_list_super_user_event = Event(
|
|
name="account_list_super_user_event",
|
|
key="7192c2aa-5352-4e36-98b3-dafb7d036a3d",
|
|
request_validator=AccountRequestValidators.ListAccountRecord,
|
|
# response_validator=SelectResponseAccount,
|
|
# language_models=[AccountRecords.__language_model__],
|
|
language_models=[],
|
|
statics="ACCOUNTS_LIST",
|
|
description="List all types of accounts by validation list options and queries.",
|
|
)
|
|
|
|
|
|
account_list_super_user_event.endpoint_callable = (
|
|
AccountListEventMethods.account_records_list
|
|
)
|
|
|
|
|
|
account_insert_super_user_event = Event(
|
|
name="account_insert_super_user_event",
|
|
key="31f4f32f-0cd4-4995-8a6a-f9f56335848a",
|
|
request_validator=AccountRequestValidators.InsertAccountRecord,
|
|
# response_validator=SelectResponseAccount,
|
|
# language_models=[AccountRecords.__language_model__],
|
|
language_models=[],
|
|
statics="ACCOUNT_CREATED",
|
|
description="Create a new account by validation list options and queries.",
|
|
)
|
|
|
|
|
|
account_insert_super_user_event.endpoint_callable = (
|
|
AccountCreateEventMethods.account_records_create
|
|
)
|
|
|
|
|
|
account_update_super_user_event = Event(
|
|
name="account_insert_super_user_event",
|
|
key="208e6273-17ef-44f0-814a-8098f816b63a",
|
|
request_validator=AccountRequestValidators.UpdateAccountRecord,
|
|
# response_validator=SelectResponseAccount,
|
|
# language_models=[AccountRecords.__language_model__],
|
|
language_models=[],
|
|
statics="ACCOUNT_UPDATED",
|
|
description="Update a specific account by validation list options and queries.",
|
|
)
|
|
|
|
|
|
account_update_super_user_event.endpoint_callable = (
|
|
AccountUpdateEventMethods.account_records_update
|
|
)
|
|
|
|
|
|
class SuperUserAccountEvents:
|
|
SuperUserListEvent = account_list_super_user_event
|
|
SuperUserCreateEvent = account_insert_super_user_event
|
|
SuperUserUpdateEvent = account_update_super_user_event
|