from rest_framework.routers import DefaultRouter
from django.urls import path, include
from . import views
from .views_api import CurrencyViewSet, DevelopmentViewSet, FlatViewSet
from .views_sync import SyncStatusView, SyncDataView, FullSyncView

router = DefaultRouter()
router.register(r'currencies', CurrencyViewSet)
router.register(r'developments', DevelopmentViewSet, basename='development')
router.register(r'flats', FlatViewSet, basename='flat')

urlpatterns = [
    path('api/', include(router.urls)),
    path('api/sync/status/', SyncStatusView.as_view(), name='sync_status'),
    path('api/sync/changes/', SyncDataView.as_view(), name='sync_changes'),
    path('api/sync/full/', FullSyncView.as_view(), name='full_sync'),
    path('master/developments/', views.master_developments, name='master_developments'),
    path('master/developments/list/', views.master_developments_list, name='master_developments_list'),
    path('master/developments/<id>/', views.master_development, name='master_development'),
    path('master/developments/<id>/form/', views.master_development_edit_form, name='master_development_edit_form'),
    path('master/developments/<id>/edit/', views.master_development_edit, name='master_development_edit'),
    path('master/developments/<id>/edit_text/', views.master_development_text_edit, name='master_development_text_edit'),
]