separate FSM
This commit is contained in:
4
app/FSM/__init__.py
Normal file
4
app/FSM/__init__.py
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
from .states import OrderForm, SearchForm, OrderingForm
|
||||||
|
|
||||||
|
|
||||||
|
__all__ = ["SearchForm", "OrderForm", "OrderingForm"]
|
||||||
24
app/FSM/states.py
Normal file
24
app/FSM/states.py
Normal file
@@ -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()
|
||||||
|
|
||||||
|
|
||||||
@@ -33,24 +33,6 @@ find_order_params = {"search_by_name": "Поиск по названию", "sear
|
|||||||
"search_by_id": "Поиск по номеру заказа", "search_by_customer": "Поиск по заказчику"}
|
"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"))
|
@orders_router.message(Command(commands="orders"))
|
||||||
async def orders_menu(message: Message):
|
async def orders_menu(message: Message):
|
||||||
order_main_upd = order_main_update if await IsAdmin()(message) else {}
|
order_main_upd = order_main_update if await IsAdmin()(message) else {}
|
||||||
|
|||||||
Reference in New Issue
Block a user