from django.conf.urls import url
from django.urls import path, include

from systori.apps.user.authorization import office_auth
from systori.apps.equipment.views import EquipmentListView, EquipmentView, EquipmentCreate, EquipmentDelete, EquipmentUpdate, RefuelingStopCreate, RefuelingStopDelete, RefuelingStopUpdate, MaintenanceCreate, MaintenanceDelete, MaintenanceUpdate


urlpatterns = [
    # two url rules to make the active_filter keyword optional
    url(
        r"^equipment/$", office_auth(EquipmentListView.as_view()), name="equipment.list"
    ),
    url(
        r"^equipment/(?P<active_filter>[\w-]+)$",
        office_auth(EquipmentListView.as_view()),
        name="equipment.list",
    ),
    url(
        r"^equipment-(?P<pk>\d+)$",
        office_auth(EquipmentView.as_view()),
        name="equipment.view",
    ),
    url(
        r"^create-equipment$",
        office_auth(EquipmentCreate.as_view()),
        name="equipment.create",
    ),
    url(
        r"^equipment-(?P<pk>\d+)/edit$",
        office_auth(EquipmentUpdate.as_view()),
        name="equipment.edit",
    ),
    url(
        r"^equipment-(?P<pk>\d+)/delete$",
        office_auth(EquipmentDelete.as_view()),
        name="equipment.delete",
    ),
    url(
        r"^equipment-(?P<pk>\d+)/create-refueling-stop$",
        office_auth(RefuelingStopCreate.as_view()),
        name="refueling_stop.create",
    ),
    url(
        r"^equipment-(?P<equipment_pk>\d+)/refueling-stop-(?P<pk>\d+)/update$",
        office_auth(RefuelingStopUpdate.as_view()),
        name="refueling_stop.update",
    ),
    url(
        r"^equipment-(?P<equipment_pk>\d+)/refueling-stop-(?P<pk>\d+)/delete",
        office_auth(RefuelingStopDelete.as_view()),
        name="refueling_stop.delete",
    ),
    url(
        r"^equipment-(?P<pk>\d+)/create-maintenance",
        office_auth(MaintenanceCreate.as_view()),
        name="maintenance.create",
    ),
    url(
        r"^equipment-(?P<equipment_pk>\d+)/maintenance-(?P<pk>\d+)/update$",
        office_auth(MaintenanceUpdate.as_view()),
        name="maintenance.update",
    ),
    url(
        r"^equipment-(?P<equipment_pk>\d+)/maintenance-(?P<pk>\d+)/delete",
        office_auth(MaintenanceDelete.as_view()),
        name="maintenance.delete",
    ),
]

[((11, 37, 11, 64), 'systori.apps.equipment.views.EquipmentListView.as_view', 'EquipmentListView.as_view', ({}, {}), '()', False, 'from systori.apps.equipment.views import EquipmentListView, EquipmentView, EquipmentCreate, EquipmentDelete, EquipmentUpdate, RefuelingStopCreate, RefuelingStopDelete, RefuelingStopUpdate, MaintenanceCreate, MaintenanceDelete, MaintenanceUpdate\n'), ((15, 20, 15, 47), 'systori.apps.equipment.views.EquipmentListView.as_view', 'EquipmentListView.as_view', ({}, {}), '()', False, 'from systori.apps.equipment.views import EquipmentListView, EquipmentView, EquipmentCreate, EquipmentDelete, EquipmentUpdate, RefuelingStopCreate, RefuelingStopDelete, RefuelingStopUpdate, MaintenanceCreate, MaintenanceDelete, MaintenanceUpdate\n'), ((20, 20, 20, 43), 'systori.apps.equipment.views.EquipmentView.as_view', 'EquipmentView.as_view', ({}, {}), '()', False, 'from systori.apps.equipment.views import EquipmentListView, EquipmentView, EquipmentCreate, EquipmentDelete, EquipmentUpdate, RefuelingStopCreate, RefuelingStopDelete, RefuelingStopUpdate, MaintenanceCreate, MaintenanceDelete, MaintenanceUpdate\n'), ((25, 20, 25, 45), 'systori.apps.equipment.views.EquipmentCreate.as_view', 'EquipmentCreate.as_view', ({}, {}), '()', False, 'from systori.apps.equipment.views import EquipmentListView, EquipmentView, EquipmentCreate, EquipmentDelete, EquipmentUpdate, RefuelingStopCreate, RefuelingStopDelete, RefuelingStopUpdate, MaintenanceCreate, MaintenanceDelete, MaintenanceUpdate\n'), ((30, 20, 30, 45), 'systori.apps.equipment.views.EquipmentUpdate.as_view', 'EquipmentUpdate.as_view', ({}, {}), '()', False, 'from systori.apps.equipment.views import EquipmentListView, EquipmentView, EquipmentCreate, EquipmentDelete, EquipmentUpdate, RefuelingStopCreate, RefuelingStopDelete, RefuelingStopUpdate, MaintenanceCreate, MaintenanceDelete, MaintenanceUpdate\n'), ((35, 20, 35, 45), 'systori.apps.equipment.views.EquipmentDelete.as_view', 'EquipmentDelete.as_view', ({}, {}), '()', False, 'from systori.apps.equipment.views import EquipmentListView, EquipmentView, EquipmentCreate, EquipmentDelete, EquipmentUpdate, RefuelingStopCreate, RefuelingStopDelete, RefuelingStopUpdate, MaintenanceCreate, MaintenanceDelete, MaintenanceUpdate\n'), ((40, 20, 40, 49), 'systori.apps.equipment.views.RefuelingStopCreate.as_view', 'RefuelingStopCreate.as_view', ({}, {}), '()', False, 'from systori.apps.equipment.views import EquipmentListView, EquipmentView, EquipmentCreate, EquipmentDelete, EquipmentUpdate, RefuelingStopCreate, RefuelingStopDelete, RefuelingStopUpdate, MaintenanceCreate, MaintenanceDelete, MaintenanceUpdate\n'), ((45, 20, 45, 49), 'systori.apps.equipment.views.RefuelingStopUpdate.as_view', 'RefuelingStopUpdate.as_view', ({}, {}), '()', False, 'from systori.apps.equipment.views import EquipmentListView, EquipmentView, EquipmentCreate, EquipmentDelete, EquipmentUpdate, RefuelingStopCreate, RefuelingStopDelete, RefuelingStopUpdate, MaintenanceCreate, MaintenanceDelete, MaintenanceUpdate\n'), ((50, 20, 50, 49), 'systori.apps.equipment.views.RefuelingStopDelete.as_view', 'RefuelingStopDelete.as_view', ({}, {}), '()', False, 'from systori.apps.equipment.views import EquipmentListView, EquipmentView, EquipmentCreate, EquipmentDelete, EquipmentUpdate, RefuelingStopCreate, RefuelingStopDelete, RefuelingStopUpdate, MaintenanceCreate, MaintenanceDelete, MaintenanceUpdate\n'), ((55, 20, 55, 47), 'systori.apps.equipment.views.MaintenanceCreate.as_view', 'MaintenanceCreate.as_view', ({}, {}), '()', False, 'from systori.apps.equipment.views import EquipmentListView, EquipmentView, EquipmentCreate, EquipmentDelete, EquipmentUpdate, RefuelingStopCreate, RefuelingStopDelete, RefuelingStopUpdate, MaintenanceCreate, MaintenanceDelete, MaintenanceUpdate\n'), ((60, 20, 60, 47), 'systori.apps.equipment.views.MaintenanceUpdate.as_view', 'MaintenanceUpdate.as_view', ({}, {}), '()', False, 'from systori.apps.equipment.views import EquipmentListView, EquipmentView, EquipmentCreate, EquipmentDelete, EquipmentUpdate, RefuelingStopCreate, RefuelingStopDelete, RefuelingStopUpdate, MaintenanceCreate, MaintenanceDelete, MaintenanceUpdate\n'), ((65, 20, 65, 47), 'systori.apps.equipment.views.MaintenanceDelete.as_view', 'MaintenanceDelete.as_view', ({}, {}), '()', False, 'from systori.apps.equipment.views import EquipmentListView, EquipmentView, EquipmentCreate, EquipmentDelete, EquipmentUpdate, RefuelingStopCreate, RefuelingStopDelete, RefuelingStopUpdate, MaintenanceCreate, MaintenanceDelete, MaintenanceUpdate\n')]