2022-10-08 00:48:53 +03:00
|
|
|
from django.urls import path, include
|
|
|
|
from rest_framework_simplejwt.views import TokenObtainPairView, TokenRefreshView
|
|
|
|
|
2022-10-09 04:33:12 +03:00
|
|
|
from blockchain.api.views import (
|
|
|
|
TransactFromAdminView,
|
|
|
|
TransactToUserView,
|
|
|
|
TransactToAdminView,
|
2022-10-09 06:27:35 +03:00
|
|
|
GetMoneyApi,
|
|
|
|
TransactionHistoryApi,
|
2022-10-09 04:33:12 +03:00
|
|
|
)
|
2022-10-09 00:42:30 +03:00
|
|
|
from events.api.views import (
|
|
|
|
ListCreateEventApi,
|
|
|
|
RetrieveUpdateDeleteEventApi,
|
|
|
|
ListPlannedEvents,
|
|
|
|
RetrieveSubmitDeleteEventAttendance,
|
|
|
|
ListAttendedWorkersApi,
|
|
|
|
SubmitWorkerAttendedEvent,
|
|
|
|
)
|
2022-10-09 06:27:35 +03:00
|
|
|
from marketplace.api.views import ListCreateProductApi, RetrieveUpdateDestroyProductApi, BuyProductApi
|
2022-10-08 16:02:57 +03:00
|
|
|
from users.api.views import (
|
|
|
|
ListCreateUserApi,
|
2022-10-09 00:42:30 +03:00
|
|
|
RetrieveUpdateDeleteUserApi,
|
2022-10-08 16:02:57 +03:00
|
|
|
ListCreateDepartmentApi,
|
2022-10-09 00:42:30 +03:00
|
|
|
RetrieveUpdateDeleteDepartmentApi,
|
2022-10-08 16:02:57 +03:00
|
|
|
ListCreateStreamApi,
|
2022-10-09 00:42:30 +03:00
|
|
|
RetrieveUpdateDeleteStreamApi,
|
2022-10-08 16:02:57 +03:00
|
|
|
ListCreateCommandApi,
|
2022-10-09 00:42:30 +03:00
|
|
|
RetrieveUpdateDeleteCommandApi,
|
2022-10-08 19:33:58 +03:00
|
|
|
CreateSeasonApi,
|
2022-10-09 00:42:30 +03:00
|
|
|
ListClansApiView,
|
2022-10-09 06:27:35 +03:00
|
|
|
GetSelfUserApi,
|
2022-10-08 16:02:57 +03:00
|
|
|
)
|
2022-10-08 11:21:53 +03:00
|
|
|
|
2022-10-08 00:48:53 +03:00
|
|
|
urlpatterns = [
|
|
|
|
path(
|
|
|
|
"auth/",
|
|
|
|
include(
|
|
|
|
[
|
|
|
|
path("token/", TokenObtainPairView.as_view(), name="token_obtain_pair"),
|
|
|
|
path("refresh/", TokenRefreshView.as_view(), name="token_refresh"),
|
|
|
|
]
|
|
|
|
),
|
|
|
|
),
|
2022-10-09 04:33:12 +03:00
|
|
|
path(
|
|
|
|
"blockchain/",
|
|
|
|
include(
|
|
|
|
[
|
|
|
|
path(
|
|
|
|
"salary/",
|
|
|
|
TransactFromAdminView.as_view(),
|
|
|
|
name="admin_to_user_transaction_api",
|
|
|
|
),
|
|
|
|
path(
|
|
|
|
"payment/",
|
|
|
|
TransactToAdminView.as_view(),
|
|
|
|
name="user_to_admin_transaction_api",
|
|
|
|
),
|
|
|
|
path(
|
|
|
|
"transact/",
|
|
|
|
TransactToUserView.as_view(),
|
|
|
|
name="user_to_user_transaction_api",
|
|
|
|
),
|
|
|
|
path(
|
|
|
|
"amount/",
|
|
|
|
GetMoneyApi.as_view(),
|
|
|
|
name="get_user_money_api",
|
|
|
|
),
|
|
|
|
path(
|
|
|
|
"history/",
|
|
|
|
TransactionHistoryApi.as_view(),
|
|
|
|
name="list_transactions_api",
|
|
|
|
),
|
|
|
|
]
|
|
|
|
),
|
|
|
|
),
|
2022-10-08 19:31:01 +03:00
|
|
|
path(
|
|
|
|
"events/",
|
|
|
|
include(
|
|
|
|
[
|
|
|
|
path("", ListCreateEventApi.as_view(), name="list_create_event"),
|
|
|
|
path(
|
|
|
|
"<str:slug>",
|
2022-10-09 00:42:30 +03:00
|
|
|
RetrieveUpdateDeleteEventApi.as_view(),
|
2022-10-08 19:31:01 +03:00
|
|
|
name="get_update_delete_event",
|
|
|
|
),
|
2022-10-09 00:42:30 +03:00
|
|
|
path(
|
|
|
|
"attendance/",
|
|
|
|
ListPlannedEvents.as_view(),
|
|
|
|
name="list_event_attendance",
|
|
|
|
),
|
|
|
|
path(
|
|
|
|
"attendance/<str:slug>/list/",
|
|
|
|
ListAttendedWorkersApi.as_view(),
|
|
|
|
name="list_event_attendance",
|
|
|
|
),
|
|
|
|
path(
|
|
|
|
"attendance/<str:slug>/submit/",
|
|
|
|
SubmitWorkerAttendedEvent.as_view(),
|
|
|
|
name="submit_event_attendance",
|
|
|
|
),
|
|
|
|
path(
|
|
|
|
"attendance/<str:slug>",
|
|
|
|
RetrieveSubmitDeleteEventAttendance.as_view(),
|
|
|
|
name="get_submit_delete_event_attendance",
|
|
|
|
),
|
2022-10-08 19:31:01 +03:00
|
|
|
]
|
|
|
|
),
|
|
|
|
),
|
2022-10-08 00:48:53 +03:00
|
|
|
path(
|
2022-10-08 11:21:53 +03:00
|
|
|
"marketplace/",
|
2022-10-08 00:48:53 +03:00
|
|
|
include(
|
|
|
|
[
|
2022-10-08 11:21:53 +03:00
|
|
|
path(
|
|
|
|
"product/",
|
|
|
|
ListCreateProductApi.as_view(),
|
|
|
|
name="list_create_product",
|
|
|
|
),
|
|
|
|
path(
|
|
|
|
"product/<str:slug>",
|
2022-10-09 00:42:30 +03:00
|
|
|
RetrieveUpdateDestroyProductApi.as_view(),
|
2022-10-08 11:21:53 +03:00
|
|
|
name="get_update_destroy_product",
|
|
|
|
),
|
2022-10-09 06:27:35 +03:00
|
|
|
path(
|
|
|
|
"product/<str:slug>/buy",
|
|
|
|
BuyProductApi.as_view(),
|
|
|
|
name="bui_product",
|
|
|
|
),
|
2022-10-08 00:48:53 +03:00
|
|
|
]
|
|
|
|
),
|
|
|
|
),
|
2022-10-08 13:52:49 +03:00
|
|
|
path(
|
|
|
|
"users/",
|
|
|
|
include(
|
|
|
|
[
|
2022-10-08 16:02:57 +03:00
|
|
|
path("", ListCreateUserApi.as_view(), name="list_create_user"),
|
2022-10-09 06:27:35 +03:00
|
|
|
path("self/", GetSelfUserApi.as_view(), name="get_self_user_api"),
|
2022-10-08 16:02:57 +03:00
|
|
|
path(
|
|
|
|
"<str:username>",
|
2022-10-09 00:42:30 +03:00
|
|
|
RetrieveUpdateDeleteUserApi.as_view(),
|
2022-10-08 16:02:57 +03:00
|
|
|
name="get_update_delete_user",
|
|
|
|
),
|
|
|
|
path(
|
|
|
|
"department/",
|
|
|
|
ListCreateDepartmentApi.as_view(),
|
|
|
|
name="list_create_department",
|
|
|
|
),
|
|
|
|
path(
|
|
|
|
"department/",
|
|
|
|
ListCreateDepartmentApi.as_view(),
|
|
|
|
name="list_create_department",
|
|
|
|
),
|
|
|
|
path(
|
|
|
|
"department/<int:pk>",
|
2022-10-09 00:42:30 +03:00
|
|
|
RetrieveUpdateDeleteDepartmentApi.as_view(),
|
2022-10-08 16:02:57 +03:00
|
|
|
name="get_update_delete_department",
|
|
|
|
),
|
|
|
|
path(
|
|
|
|
"stream/",
|
|
|
|
ListCreateStreamApi.as_view(),
|
|
|
|
name="list_create_stream",
|
|
|
|
),
|
|
|
|
path(
|
|
|
|
"stream/<int:pk>",
|
2022-10-09 00:42:30 +03:00
|
|
|
RetrieveUpdateDeleteStreamApi.as_view(),
|
2022-10-08 16:02:57 +03:00
|
|
|
name="get_update_delete_stream",
|
|
|
|
),
|
|
|
|
path(
|
|
|
|
"command/",
|
|
|
|
ListCreateCommandApi.as_view(),
|
|
|
|
name="list_create_command",
|
|
|
|
),
|
|
|
|
path(
|
|
|
|
"command/<int:pk>",
|
2022-10-09 00:42:30 +03:00
|
|
|
RetrieveUpdateDeleteCommandApi.as_view(),
|
2022-10-08 16:02:57 +03:00
|
|
|
name="get_update_delete_command",
|
|
|
|
),
|
2022-10-08 13:52:49 +03:00
|
|
|
]
|
|
|
|
),
|
|
|
|
),
|
2022-10-08 17:14:19 +03:00
|
|
|
path(
|
2022-10-08 19:57:46 +03:00
|
|
|
"season/",
|
2022-10-09 00:42:30 +03:00
|
|
|
include(
|
|
|
|
[
|
|
|
|
path("", CreateSeasonApi.as_view(), name="create new season"),
|
|
|
|
path("clans/", ListClansApiView.as_view()),
|
|
|
|
]
|
|
|
|
),
|
2022-10-08 19:33:58 +03:00
|
|
|
),
|
2022-10-08 00:48:53 +03:00
|
|
|
]
|