diff --git a/app/FSM/__init__.py b/app/FSM/__init__.py new file mode 100644 index 0000000..67a7018 --- /dev/null +++ b/app/FSM/__init__.py @@ -0,0 +1,4 @@ +from .states import OrderForm, SearchForm, OrderingForm + + +__all__ = ["SearchForm", "OrderForm", "OrderingForm"] \ No newline at end of file diff --git a/app/FSM/states.py b/app/FSM/states.py new file mode 100644 index 0000000..54bc7aa --- /dev/null +++ b/app/FSM/states.py @@ -0,0 +1,24 @@ +from aiogram.fsm.state import State, StatesGroup + + +class SearchForm(StatesGroup): + search_option = State() + data_to_search = State() + search_result = State() + + +class OrderForm(StatesGroup): + id = State() + worker_id = State() + status_id = State() + counterparty = State() + customer = State() + commencement_work = State() + end_work = State() + description = State() + + +class OrderingForm(StatesGroup): + tools_list = State() + + diff --git a/app/handlers/orders.py b/app/handlers/orders.py index ed32ad6..754fd8c 100644 --- a/app/handlers/orders.py +++ b/app/handlers/orders.py @@ -33,24 +33,6 @@ find_order_params = {"search_by_name": "Поиск по названию", "sear "search_by_id": "Поиск по номеру заказа", "search_by_customer": "Поиск по заказчику"} -class SearchForm(StatesGroup): - search_option = State() - data_to_search = State() - search_result = State() - - -class OrderForm(StatesGroup): - id = State() - worker_id = State() - status_id = State() - counterparty = State() - customer = State() - commencement_work = State() - end_work = State() - - description = State() - - @orders_router.message(Command(commands="orders")) async def orders_menu(message: Message): order_main_upd = order_main_update if await IsAdmin()(message) else {}