# -*- coding: utf-8 -*-
"""
Inventory Views Package

Организация views по модулям:
- warehouse.py: Управление складами
- incoming.py: Управление приходами товара
- sale.py: Управление продажами
- inventory_ops.py: Инвентаризация и её строки
- writeoff_document.py: Документы списания товара
- transfer.py: Перемещения между складами
- reservation.py: Резервирования товара (view-only)
- stock.py: Справочник остатков (view-only)
- batch.py: Справочник партий товара (view-only)
- allocation.py: Распределение продаж по партиям (view-only)
"""
from django.shortcuts import render
from django.contrib.auth.decorators import login_required

from .warehouse import WarehouseListView, WarehouseCreateView, WarehouseUpdateView, WarehouseDeleteView, SetDefaultWarehouseView
from .batch import StockBatchListView, StockBatchDetailView
from .sale import SaleListView, SaleCreateView, SaleUpdateView, SaleDeleteView, SaleDetailView
from .inventory_ops import (
    InventoryListView, InventoryCreateView, InventoryDetailView,
    InventoryLineCreateBulkView, InventoryLineAddView, InventoryLineUpdateView,
    InventoryLineDeleteView, InventoryCompleteView, InventoryDeleteView
)
from .writeoff_document import (
    WriteOffDocumentListView, WriteOffDocumentCreateView, WriteOffDocumentDetailView,
    WriteOffDocumentAddItemView, WriteOffDocumentUpdateItemView, WriteOffDocumentRemoveItemView,
    WriteOffDocumentConfirmView, WriteOffDocumentCancelView
)
from .incoming_document import (
    IncomingDocumentListView, IncomingDocumentCreateView, IncomingDocumentDetailView,
    IncomingDocumentAddItemView, IncomingDocumentUpdateItemView, IncomingDocumentRemoveItemView,
    IncomingDocumentConfirmView, IncomingDocumentCancelView
)
from .transfer import TransferListView, TransferBulkCreateView, TransferDetailView, TransferDeleteView, GetProductStockView
from .reservation import ReservationListView
from .stock import StockListView, StockDetailView
from .allocation import SaleBatchAllocationListView


@login_required
def inventory_home(request):
    """
    Главная страница Склада для управления инвентаризацией
    """
    return render(request, 'inventory/home.html')


__all__ = [
    # Home
    'inventory_home',
    # Warehouse
    'WarehouseListView', 'WarehouseCreateView', 'WarehouseUpdateView', 'WarehouseDeleteView', 'SetDefaultWarehouseView',
    # Sale
    'SaleListView', 'SaleCreateView', 'SaleUpdateView', 'SaleDeleteView', 'SaleDetailView',
    # Inventory
    'InventoryListView', 'InventoryCreateView', 'InventoryDetailView', 'InventoryLineCreateBulkView',
    'InventoryLineAddView', 'InventoryLineUpdateView', 'InventoryLineDeleteView',
    'InventoryCompleteView', 'InventoryDeleteView',
    # WriteOffDocument
    'WriteOffDocumentListView', 'WriteOffDocumentCreateView', 'WriteOffDocumentDetailView',
    'WriteOffDocumentAddItemView', 'WriteOffDocumentUpdateItemView', 'WriteOffDocumentRemoveItemView',
    'WriteOffDocumentConfirmView', 'WriteOffDocumentCancelView',
    # IncomingDocument
    'IncomingDocumentListView', 'IncomingDocumentCreateView', 'IncomingDocumentDetailView',
    'IncomingDocumentAddItemView', 'IncomingDocumentUpdateItemView', 'IncomingDocumentRemoveItemView',
    'IncomingDocumentConfirmView', 'IncomingDocumentCancelView',
    # Transfer
    'TransferListView', 'TransferBulkCreateView', 'TransferDetailView', 'TransferDeleteView', 'GetProductStockView',
    # Reservation
    'ReservationListView',
    # Stock
    'StockListView', 'StockDetailView',
    # StockBatch
    'StockBatchListView', 'StockBatchDetailView',
    # Allocation
    'SaleBatchAllocationListView',
]
