"""This module holds the api-related urls for the brainstormers app"""

from rest_framework_extensions.routers import ExtendedDefaultRouter

from . import views

router = ExtendedDefaultRouter(trailing_slash=False)

# Route for brainstormer
brainstormer_router = router.register(r'brainstormers', views.BrainstormerViewSet)

# Route for propositions
brainstormer_router.register(
    r'propositions',
    views.BrainstormerPropositionViewSet,
    base_name='brainstormer_proposition',
    parents_query_lookups=['brainstormer']
)

# Route for groups
brainstormer_router.register(
    r'groups',
    views.BrainstormerPropositionGroupViewSet,
    base_name='brainstormer_group',
    parents_query_lookups=['brainstormer']
).register(
    r'propositions',
    views.BrainstormerPropositionViewSet,
    base_name='brainstormer_proposition',
    parents_query_lookups=['group__brainstormer', 'group']
)

urlpatterns = router.urls
