from api_initializer.event_clusters import EventCluster, RouterCluster
from index import endpoints_index
from .supers_events import (
    SuperBuildListEvent,
    SuperBuildCreateEvent,
    SuperBuildUpdateEvent,
    SuperBuildDeleteEvent,
)

BuildRouterCluster = RouterCluster(name="BuildRouterCluster")

BuildListEventCluster = EventCluster(name="BuildListEventCluster", endpoint_uu_id=endpoints_index["BuildList"])
BuildListEventCluster.add_event(SuperBuildListEvent)

BuildCreateEventCluster = EventCluster(name="BuildCreateEventCluster", endpoint_uu_id=endpoints_index["BuildCreate"])
BuildCreateEventCluster.add_event(SuperBuildCreateEvent)

BuildUpdateEventCluster = EventCluster(name="BuildUpdateEventCluster", endpoint_uu_id=endpoints_index["BuildUpdate"])
BuildUpdateEventCluster.add_event(SuperBuildUpdateEvent)

BuildDeleteEventCluster = EventCluster(name="BuildDeleteEventCluster", endpoint_uu_id=endpoints_index["BuildDelete"])
BuildDeleteEventCluster.add_event(SuperBuildDeleteEvent)

BuildRouterCluster.set_event_cluster(BuildListEventCluster)
BuildRouterCluster.set_event_cluster(BuildCreateEventCluster)
BuildRouterCluster.set_event_cluster(BuildUpdateEventCluster)
BuildRouterCluster.set_event_cluster(BuildDeleteEventCluster)
