# Path: core/views.py
# @api_view(['GET'])
# def api_root(request, format=None):
#     """
#     Defines the clickable links displayed on the server endpoint.
#     All the reachable endpoints don't appear here
#     """
#     kwargs = { 'request': request, 'format': format }
#     return Response({
#         # Login & Users
#         'login':           reverse('login',                **kwargs),
#         'me':              reverse('me',                   **kwargs),
#         'users':           reverse('users-list',           **kwargs),
#         'usertypes':       reverse('usertypes-list',       **kwargs),
#         'associations':    reverse('associations-list',    **kwargs),
# 
#         # Sales & Item
#         'sales':           reverse('sales-list',           **kwargs),
#         'itemgroups':      reverse('itemgroups-list',      **kwargs),
#         'items':           reverse('items-list',           **kwargs),
# 
#         # Orders
#         'orders':          reverse('orders-list',          **kwargs),
#         'orderlines':      reverse('orderlines-list',      **kwargs),
# 
#         # Fields
#         'fields':          reverse('fields-list',          **kwargs),
#         'itemfields':      reverse('itemfields-list',      **kwargs),
#         'orderlinefields': reverse('orderlinefields-list', **kwargs),
#         'orderlineitems':  reverse('orderlineitems-list',  **kwargs),
# 
#         # TODO PaymentMethods
#         # 'paymentmethods':  reverse('paymentmethods-list',  **kwargs),
#     })


from django.conf.urls import url, include
from django.contrib import admin
from core.views import api_root


urlpatterns = [
    url(r'^$',       api_root,        name='root'),     # Api Root pour la documentation
    url(r'^admin/',  admin.site.urls, name='admin'),    # Administration du site en backoffice
    url(r'^',        include('authentication.urls')),   # Routes d'authentification

# Path: core/views.py
# @api_view(['GET'])
# def api_root(request, format=None):
#     """
#     Defines the clickable links displayed on the server endpoint.
#     All the reachable endpoints don't appear here
#     """
#     kwargs = { 'request': request, 'format': format }
#     return Response({
#         # Login & Users
#         'login':           reverse('login',                **kwargs),
#         'me':              reverse('me',                   **kwargs),
#         'users':           reverse('users-list',           **kwargs),
#         'usertypes':       reverse('usertypes-list',       **kwargs),
#         'associations':    reverse('associations-list',    **kwargs),
# 
#         # Sales & Item
#         'sales':           reverse('sales-list',           **kwargs),
#         'itemgroups':      reverse('itemgroups-list',      **kwargs),
#         'items':           reverse('items-list',           **kwargs),
# 
#         # Orders
#         'orders':          reverse('orders-list',          **kwargs),
#         'orderlines':      reverse('orderlines-list',      **kwargs),
# 
#         # Fields
#         'fields':          reverse('fields-list',          **kwargs),
#         'itemfields':      reverse('itemfields-list',      **kwargs),
#         'orderlinefields': reverse('orderlinefields-list', **kwargs),
#         'orderlineitems':  reverse('orderlineitems-list',  **kwargs),
# 
#         # TODO PaymentMethods
#         # 'paymentmethods':  reverse('paymentmethods-list',  **kwargs),
#     })


# Path: woolly_api/urls.py
from django.conf.urls import url, include
from django.contrib import admin
from core.views import api_root



urlpatterns = [
    url(r'^$',       api_root,        name='root'),     # Api Root pour la documentation
    url(r'^admin/',  admin.site.urls, name='admin'),    # Administration du site en backoffice
    url(r'^',        include('authentication.urls')),   # Routes d'authentification

    url(r'^',        include('sales.urls')),            # Routes pour les ventes