events updated
This commit is contained in:
@@ -1,5 +0,0 @@
|
||||
from api_events.events.abstract_class import MethodToEvent, ActionsSchema
|
||||
from api_objects.auth.token_objects import EmployeeTokenObject, OccupantTokenObject
|
||||
|
||||
|
||||
class ApiEvents(MethodToEvent): ...
|
||||
126
api_events/events/account/account_records.py
Normal file
126
api_events/events/account/account_records.py
Normal file
@@ -0,0 +1,126 @@
|
||||
import typing
|
||||
|
||||
from databases import (
|
||||
AccountRecords,
|
||||
)
|
||||
|
||||
from api_validations.validations_request import (
|
||||
InsertAccountRecord,
|
||||
UpdateAccountRecord,
|
||||
ListOptions,
|
||||
)
|
||||
|
||||
from api_validations.core_response import AlchemyJsonResponse
|
||||
from api_events.events.abstract_class import MethodToEvent, ActionsSchema
|
||||
from api_objects.auth.token_objects import EmployeeTokenObject, OccupantTokenObject
|
||||
|
||||
|
||||
class AccountRecordsListEventMethods(MethodToEvent):
|
||||
|
||||
event_type = "SELECT"
|
||||
__event_keys__ = {
|
||||
"": "account_records_list",
|
||||
}
|
||||
|
||||
@classmethod
|
||||
def account_records_list(
|
||||
cls,
|
||||
list_options: ListOptions,
|
||||
token_dict: typing.Union[EmployeeTokenObject, OccupantTokenObject],
|
||||
):
|
||||
if isinstance(token_dict, OccupantTokenObject):
|
||||
pass
|
||||
elif isinstance(token_dict, EmployeeTokenObject):
|
||||
pass
|
||||
|
||||
return AlchemyJsonResponse(
|
||||
completed=True,
|
||||
message="Update Build record",
|
||||
result=None
|
||||
)
|
||||
|
||||
|
||||
class AccountRecordsCreateEventMethods(MethodToEvent):
|
||||
|
||||
event_type = "CREATE"
|
||||
__event_keys__ = {
|
||||
"": "account_records_create",
|
||||
}
|
||||
|
||||
@classmethod
|
||||
def account_records_create(
|
||||
cls,
|
||||
data: InsertAccountRecord,
|
||||
token_dict: typing.Union[EmployeeTokenObject, OccupantTokenObject],
|
||||
):
|
||||
if isinstance(token_dict, OccupantTokenObject):
|
||||
pass
|
||||
elif isinstance(token_dict, EmployeeTokenObject):
|
||||
pass
|
||||
|
||||
return AlchemyJsonResponse(
|
||||
completed=True,
|
||||
message="Update Build record",
|
||||
result=None,
|
||||
)
|
||||
|
||||
|
||||
class AccountRecordsUpdateEventMethods(MethodToEvent):
|
||||
|
||||
event_type = "UPDATE"
|
||||
__event_keys__ = {
|
||||
"": "account_records_update",
|
||||
}
|
||||
|
||||
@classmethod
|
||||
def build_area_update(
|
||||
cls,
|
||||
build_uu_id: str,
|
||||
data: UpdateAccountRecord,
|
||||
token_dict: typing.Union[EmployeeTokenObject, OccupantTokenObject],
|
||||
):
|
||||
if isinstance(token_dict, OccupantTokenObject):
|
||||
pass
|
||||
elif isinstance(token_dict, EmployeeTokenObject):
|
||||
pass
|
||||
|
||||
return AlchemyJsonResponse(
|
||||
completed=False,
|
||||
message="Update Build record",
|
||||
result=None,
|
||||
)
|
||||
|
||||
|
||||
class AccountRecordsPatchEventMethods(MethodToEvent):
|
||||
|
||||
event_type = "PATCH"
|
||||
__event_keys__ = {
|
||||
"": "account_records_patch",
|
||||
}
|
||||
|
||||
@classmethod
|
||||
def build_area_patch(
|
||||
cls,
|
||||
build_uu_id: str,
|
||||
data,
|
||||
token_dict: typing.Union[EmployeeTokenObject, OccupantTokenObject],
|
||||
):
|
||||
return AlchemyJsonResponse(
|
||||
completed=False,
|
||||
message="Patch Build record",
|
||||
result=None,
|
||||
)
|
||||
|
||||
|
||||
AccountRecordsListEventMethod = AccountRecordsListEventMethods(
|
||||
action=ActionsSchema(endpoint="/account/records/list")
|
||||
)
|
||||
AccountRecordsCreateEventMethod = AccountRecordsCreateEventMethods(
|
||||
action=ActionsSchema(endpoint="/account/records/create")
|
||||
)
|
||||
AccountRecordsUpdateEventMethod = AccountRecordsUpdateEventMethods(
|
||||
action=ActionsSchema(endpoint="/account/records/update")
|
||||
)
|
||||
AccountRecordsPatchEventMethod = AccountRecordsPatchEventMethods(
|
||||
action=ActionsSchema(endpoint="/account/records/patch")
|
||||
)
|
||||
Reference in New Issue
Block a user