diff --git a/compensation/account_urls.py b/compensation/account_urls.py new file mode 100644 index 00000000..222f2fc1 --- /dev/null +++ b/compensation/account_urls.py @@ -0,0 +1,31 @@ +""" +Author: Michel Peltriaux +Organization: Struktur- und Genehmigungsdirektion Nord, Rhineland-Palatinate, Germany +Contact: michel.peltriaux@sgdnord.rlp.de +Created on: 24.08.21 + +""" +from django.urls import path +from compensation.views.eco_account_views import * + +urlpatterns = [ + path("", index_view, name="acc-index"), + path('new/', new_view, name='acc-new'), + path('', open_view, name='acc-open'), + path('/log', log_view, name='acc-log'), + path('/record', record_view, name='acc-record'), + path('/edit', edit_view, name='acc-edit'), + path('/remove', remove_view, name='acc-remove'), + path('/state/new', state_new_view, name='acc-new-state'), + path('/action/new', action_new_view, name='acc-new-action'), + path('/deadline/new', deadline_new_view, name="acc-new-deadline"), + + # Documents + # Document remove route can be found in konova/urls.py + path('/document/new/', new_document_view, name='acc-new-doc'), + + # Eco-account withdraws + path('/remove/', withdraw_remove_view, name='withdraw-remove'), + path('/withdraw/new', new_withdraw_view, name='acc-new-withdraw'), + +] \ No newline at end of file diff --git a/compensation/comp_urls.py b/compensation/comp_urls.py new file mode 100644 index 00000000..1e79319b --- /dev/null +++ b/compensation/comp_urls.py @@ -0,0 +1,33 @@ +""" +Author: Michel Peltriaux +Organization: Struktur- und Genehmigungsdirektion Nord, Rhineland-Palatinate, Germany +Contact: michel.peltriaux@sgdnord.rlp.de +Created on: 24.08.21 + +""" +from django.urls import path +from compensation.views.compensation_views import * + +urlpatterns = [ + # Main compensation + path("", index_view, name="index"), + path('new', new_view, name='new'), + path('', open_view, name='open'), + path('/log', log_view, name='log'), + path('/edit', edit_view, name='edit'), + path('/remove', remove_view, name='remove'), + path('/state/new', state_new_view, name='new-state'), + path('/action/new', action_new_view, name='new-action'), + path('/deadline/new', deadline_new_view, name="new-deadline"), + + # Documents + # Document remove route can be found in konova/urls.py + path('/document/new/', new_document_view, name='new-doc'), + + # Generic state routes + path('state//remove', state_remove_view, name='state-remove'), + + # Generic action routes + path('action//remove', action_remove_view, name='action-remove'), + +] \ No newline at end of file diff --git a/compensation/models.py b/compensation/models.py index e24c33e8..840cb82a 100644 --- a/compensation/models.py +++ b/compensation/models.py @@ -38,6 +38,11 @@ class Payment(BaseResource): related_name='payments' ) + class Meta: + ordering = [ + "-amount", + ] + class CompensationState(UuidModel): """ diff --git a/compensation/payment_urls.py b/compensation/payment_urls.py new file mode 100644 index 00000000..d208b07d --- /dev/null +++ b/compensation/payment_urls.py @@ -0,0 +1,14 @@ +""" +Author: Michel Peltriaux +Organization: Struktur- und Genehmigungsdirektion Nord, Rhineland-Palatinate, Germany +Contact: michel.peltriaux@sgdnord.rlp.de +Created on: 24.08.21 + +""" +from django.urls import path +from compensation.views.payment_views import * + +urlpatterns = [ + path('/new', new_payment_view, name='pay-new'), + path('/remove', payment_remove_view, name='pay-remove'), +] diff --git a/compensation/urls.py b/compensation/urls.py index c36d45a5..368a037b 100644 --- a/compensation/urls.py +++ b/compensation/urls.py @@ -5,64 +5,11 @@ Contact: michel.peltriaux@sgdnord.rlp.de Created on: 30.11.20 """ -from django.urls import path - -from compensation.views import compensation_views -from compensation.views import payment_views -from compensation.views import eco_account_views +from django.urls import path, include app_name = "compensation" - -# Split lists for each sub-component for better overview -urlpatterns_payment = [ - path('pay//new', payment_views.new_payment_view, name='pay-new'), - path('pay//remove', payment_views.payment_remove_view, name='pay-remove'), -] - -urlaptterns_eco_acc = [ - path("acc/", eco_account_views.index_view, name="acc-index"), - path('acc/new/', eco_account_views.new_view, name='acc-new'), - path('acc/', eco_account_views.open_view, name='acc-open'), - path('acc//log', eco_account_views.log_view, name='acc-log'), - path('acc//record', eco_account_views.record_view, name='acc-record'), - path('acc//edit', eco_account_views.edit_view, name='acc-edit'), - path('acc//remove', eco_account_views.remove_view, name='acc-remove'), - path('acc//state/new', eco_account_views.state_new_view, name='acc-new-state'), - path('acc//action/new', eco_account_views.action_new_view, name='acc-new-action'), - path('acc//deadline/new', eco_account_views.deadline_new_view, name="acc-new-deadline"), - - # Documents - # Document remove route can be found in konova/urls.py - path('acc//document/new/', eco_account_views.new_document_view, name='acc-new-doc'), - - # Eco-account withdraws - path('acc//remove/', eco_account_views.withdraw_remove_view, name='withdraw-remove'), - path('acc//withdraw/new', eco_account_views.new_withdraw_view, name='acc-new-withdraw'), - -] -urlpatterns_compensation = [ - # Main compensation - path("", compensation_views.index_view, name="index"), - path('new', compensation_views.new_view, name='new'), - path('', compensation_views.open_view, name='open'), - path('/log', compensation_views.log_view, name='log'), - path('/edit', compensation_views.edit_view, name='edit'), - path('/remove', compensation_views.remove_view, name='remove'), - path('/state/new', compensation_views.state_new_view, name='new-state'), - path('/action/new', compensation_views.action_new_view, name='new-action'), - path('/deadline/new', compensation_views.deadline_new_view, name="new-deadline"), - - # Documents - # Document remove route can be found in konova/urls.py - path('/document/new/', compensation_views.new_document_view, name='new-doc'), - - # Generic state routes - path('state//remove', compensation_views.state_remove_view, name='state-remove'), - - # Generic action routes - path('action//remove', compensation_views.action_remove_view, name='action-remove'), - -] - -# Merge all together in the end -urlpatterns = urlpatterns_compensation + urlaptterns_eco_acc + urlpatterns_payment +urlpatterns = [ + path("", include("compensation.comp_urls")), + path("acc/", include("compensation.account_urls")), + path("pay/", include("compensation.payment_urls")), +] \ No newline at end of file