from django.urls import path


from items.views import item_view, property_view, relation_view, type_view


app_name = "items"

urlpatterns = [
    # Item
    path("list", item_view.item_list, name="list"),
    path("<uuid:id>", item_view.item_edit, name="edit"),
    path("<uuid:id>/details", item_view.item_details, name="details"),
    path("<uuid:id>/history", item_view.item_history, name="history"),
    path("<uuid:id>/history/<uuid:hid>", item_view.item_history_edit, name="history.edit"),
    path("create", item_view.item_edit, {"id": None}, name="create"),
    # Type
    path("type/<uuid:id>", type_view.type_edit, name="type.edit"),
    path("type/create", type_view.type_edit, {"id": None}, name="type.create"),
    # Property
    path("property/list", property_view.property_list, name="property.list"),
    path("property/<uuid:id>", property_view.property_edit, name="property.edit"),
    path("property/create", property_view.property_edit, {"id": None}, name="property.create"),
    # Linked property
    path("property/linked/<uuid:id>", property_view.linked_property_edit, name="linked.property.edit"),
    path("property/linked/create", property_view.linked_property_edit, {"id": None}, name="linked.property.create"),
    # Relation property
    path("property/relation/<uuid:id>", property_view.relation_property_edit, name="relation.property.edit"),
    path("property/relation/create", property_view.relation_property_edit, {"id": None}, name="relation.property.create"),
    # Relations
    path("relation/list", relation_view.relation_list, name="relation.list"),
    path("relation/<uuid:id>", relation_view.relation_edit, name="relation.edit"),
    path("relation/<uuid:id>/details", relation_view.relation_details, name="relation.details"),
    path("relation/create", relation_view.relation_edit, {"id": None}, name="relation.create"),
]
