from api_initializer.event_clusters import EventCluster, RouterCluster
from index import endpoints_index
from .supers_events import (
    SuperUserListEvent,
    SuperUserCreateEvent,
    SuperUserUpdateEvent,
    SuperUserDeleteEvent,
)

UserRouterCluster = RouterCluster(name="UserRouterCluster")

UserListAllEventCluster = EventCluster(name="UserListAllEventCluster", endpoint_uu_id=endpoints_index["UserList"])
UserListAllEventCluster.add_event(SuperUserListEvent)

UserCreateEventCluster = EventCluster(name="UserCreateEventCluster", endpoint_uu_id=endpoints_index["UserCreate"])
UserCreateEventCluster.add_event(SuperUserCreateEvent)

UserUpdateEventCluster = EventCluster(name="UserUpdateEventCluster", endpoint_uu_id=endpoints_index["UserUpdate"])
UserUpdateEventCluster.add_event(SuperUserUpdateEvent)

UserDeleteEventCluster = EventCluster(name="UserDeleteEventCluster", endpoint_uu_id=endpoints_index["UserDelete"])
UserDeleteEventCluster.add_event(SuperUserDeleteEvent)

UserRouterCluster.set_event_cluster(UserListAllEventCluster)
UserRouterCluster.set_event_cluster(UserCreateEventCluster)
UserRouterCluster.set_event_cluster(UserUpdateEventCluster)
UserRouterCluster.set_event_cluster(UserDeleteEventCluster)
