from django.urls import path

from . import views

app_name = "module_iam"

urlpatterns = [
    path('dashboard/', views.DashboardView.as_view(), name="dashboard"),

    # path('principal/', views.PrincipalListView.as_view(), name="principal_list"),
    path('principal/add/', views.PrincipalCreateOrUpdateView.as_view(), name="principal_add"),
    path('principal/edit/<int:pk>', views.PrincipalCreateOrUpdateView.as_view(), name="principal_edit"),
    # path('principal/delete/<int:pk>', views.PrincipalDeleteView.as_view(), name="principal_delete"),
    path('principal/archive/', views.PrincipalArchiveView.as_view(), name="principal_archive"),
    path('principal/archive/list/', views.PrincipalArchiveListJsonView.as_view(), name="principal_archive_list"),
    path('principal/resource/permission/edit/<int:pk>/', views.PrincipalResourcePermissionEditView.as_view(), name="principal_resource_permission_edit"),

    path('principal/group/link/', views.PrincipalGroupLinkView.as_view(), name="principal_group_link"),
    path('principal/group/link/list/admin/', views.PrincipalGroupLinkAdminListJsonView.as_view(), name="principal_group_link_list"),
    path('principal/group/link/list/subadmin/', views.PrincipalGroupLinkSubAdminListJsonView.as_view(), name="principal_group_link_list_sub"),
    path('principal/group/link/edit/<int:pk>/', views.PrincipalGroupLinkEditView.as_view(), name="principal_group_link_edit"),
    path('principal/group/link/action/', views.PrincipalGroupLinkActionView.as_view(), name="principal_group_link_action"),

    path('principal/group/', views.PrincipalGroupView.as_view(), name="principal_group"),
    path('principal/group/list/', views.PrincipalGroupListJsonView.as_view(), name="principal_group_list"),
    path('principal/group/add/', views.PrincipalGroupCreateOrUpdateView.as_view(), name="principal_group_add"),
    path('principal/group/edit/<int:pk>/', views.PrincipalGroupCreateOrUpdateView.as_view(), name="principal_group_edit"),
    path('principal/group/action/', views.PrincipalGroupActionView.as_view(), name="principal_group_action"),
    path('principal/group/archive/list/', views.PrincipalGroupArchiveView.as_view(), name="principal_group_archive"),

    path('principal/role/', views.AppRoleView.as_view(), name="role"),
    path('principal/role/list/', views.AppRoleListJsonView.as_view(), name="role_list"),
    path('principal/role/add/', views.AppRoleCreateOrUpdateView.as_view(), name="role_add"),
    path('principal/role/edit/<int:pk>/', views.AppRoleCreateOrUpdateView.as_view(), name="role_edit"),
    path('principal/role/action/', views.AppRoleActionView.as_view(), name="role_action"),
    path('principal/role/archive/list/', views.AppRoleArchiveView.as_view(), name="role_archive"),

    path("profile/", views.PrincipalProfileView.as_view(), name="profile_details"),
    path("profile/edit/", views.PrincipalProfileEditView.as_view(), name="profile_details_edit")

]
